今天差点儿被弄死
<input id="txtDateTime" type="text" οnclick="WdatePicker({onpicked:timeChange})" class="Wdate" value="<%=DateTime.Now.ToString("yyyy-MM-dd")%>" />
//时间改变
function timeChange() {
var tm = $("#txtDateTime").text;
var tmss= $("#txtDateTime")[0].value;
//alert(tm);
$("#txtDateTime").change(function () {
time = $("#txtDateTime").val().split('-');
time = time[0] + time[1] + time[2];
for (i = 0; i < len; i++) {
var replaceValue = (imgArray[i].split('/'))[3].split('-')[0];
var replacevalueLength = replaceValue.length;
replaceValue = replaceValue.substr(replacevalueLength - 8, replacevalueLength);
imgArray[i] = imgArray[i].replace(replaceValue, time);
}
$("#pic").attr("src", imgArray[1]);
});
}
现在还不明白为什么这么写。只是这么写就好使。尼玛。抽时间把这个东西好好弄弄。
二、jQuery中的Ajax
取到日期之后需要将日期作为参数动态刷新页面
$.ajax({
type: "get",
url: "SaveNodes.aspx?rnd=" + Math.random() + "&node=" + JSON.stringify(params),//方法所在页面和方法名
contentType: "application/json; charset=utf-8",
success: function (data) {
},
error: function (err) {
alert(err.responseText);
}
});
这个是从其它页面粘贴来的。自己的页面还木有调试。先保存之。