我想弄一个把下拉选单&datepicker 调用选中的选项讯息
其实我已经弄了一个用Date() 取得时间来取得图片的代码
http://huitc.ga/hw.html
但只能在当天有效 (学校以year + month + day + classNo来命名当天功课表的相片
????
????
<script>
????????function ImageErr(source) {
????????????source.src = null;
????????????source.onerror = "";
????????????source.setAttribute("style", "display: none;");
????????????document.getElementById("result").innerHTML = "image did not found";
????????????return true;
????????}
????????var dat = new Date();
????????var year = dat.getFullYear();
????????year = "" + year;
????????var month = dat.getMonth() + 1;
????????var day = dat.getDate();
????????if(day <= 9)
????????????day = "0" + day;
????????else
????????????day = "" + day;
????????if(month <= 9)
????????????month = "0" + month;
????????else
????????????month = "" + month;
????????var className = "4B";
????????var requestStr = year + month + day + className + ".jpg";
????????var url = "http://www.wcbss.edu.hk/learn_teach/homework/" + requestStr;
????????
????????//错误照片范例,会触发 ImageErr 方法
????????//var url = "http://www.wcbss.edu.hk/learn_teach/homework/201509084B.jpg";
????????var text = document.getElementById("text");
????????var image = document.getElementById("image");
????????image.setAttribute("src", url);
????????</script>
我想把以下选项被选中时和datepicker选中的日期调用至能够显示图片
例如下拉选单选了4b, datepicker选了2017.02.04
那么就会显示网址为 "http://www.wcbss.edu.hk/learn_teach/homework/" + year + month + day + className + ".jpg" 的图片
即显示 xxx.com + datepicker选项(年月日) + 下拉选单(class)选中项 + ".jpg" 的图片
????
????
<select id="class">
???????? <option value="bob">4a</option>
???????? <option value="nok">4b</option>
???????? <option value="na">5a</option>
???????? <option value="wcb">5b</option>
</select>
会的[email protected]详谈 感激不尽~!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…