一、 setTimeout this指向问题
setTimeout("this.count()",1000)中的this指的是window对象.
js的setTimeout定义为
复制代码 代码如下:
window.setTimeout=function(vCode, iMilliSeconds [, sLanguage]){
//.....代码
return timer//返回一个标记符
}
复制代码 代码如下:
function init(){
var url = "<%=basePath%>fetchwater.do?method=searchRealWater&xzqh=" + "<%=xzqh%>" + "&rand="+Math.random();
//alert(url);
window.setTimeout(function(){ searchJDWater(url);},100);
}
新闻热点
疑难解答
图片精选