摘要: 无论是window.setTimeout还是window.setInterval,在使用函数名作为调用句柄时都不能带参数,而在许多场合必须要带参数,这就需要想方法解决。例如对于函数hello(_name),它用于针对用户名显示欢迎信息:var userName="jack";//根据用户名显示欢迎信息function hello(_name){ alert("hello,"+_name);}这时,如果企图使用以下语句来使hello函数延迟3秒执行是不可行的:window.setTimeout(hello(userName),3000);这将使hello函 阅读全文
posted @ 2011-12-06 17:57 jhti 阅读(415) 评论(0) 推荐(0) 编辑