只需一步,快速开始
141
291
1503
金牌会员
使用道具 举报
35
4万
8942
论坛元老
liangyongfei 发表于 2017-2-14 16:37 setTimeout(this.chaxun,500);
xuanxiao325 发表于 2017-2-14 16:41 老师,这样写就报 this.getElementByXid is not a function 的错误!
liangyongfei 发表于 2017-2-14 16:43 在setTimeout 中定义的函数不能直接使用this 需要定义一个全局变量比如 var me
xuanxiao325 发表于 2017-2-14 16:51 this.chaxun() 是我自定义的一个函数啊,里面执行了一系列操作,不是全局变量! ...
liangyongfei 发表于 2017-2-14 16:55 因为它放在setTimeout 的回调中!所以this就不是表示model对象了 需要你在外边重新定义一个变量!这个方 ...
xuanxiao325 发表于 2017-2-14 16:59 var me = this; setTimeout(me.chaxun,500); 可我这样写,仍旧不对额!
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|X3技术论坛|Justep Inc.
GMT+8, 2025-6-29 03:16 , Processed in 0.051782 second(s), 24 queries .
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.