function test(){}
test.prototype = {
temp:0,
a:function(){
temp++;
window.setTimeout(this+".test()",30);
}
}为什么这样不能循环调用?、要报错,在类的方法里面调用自己方法的正确语法是怎么写??,急急急~~~~~~!!!!!!!!
test.prototype = {
temp:0,
a:function(){
temp++;
window.setTimeout(this+".test()",30);
}
}为什么这样不能循环调用?、要报错,在类的方法里面调用自己方法的正确语法是怎么写??,急急急~~~~~~!!!!!!!!
解决方案 »
- 小白求解
- 如何刷新一个框架内所有的子页面
- 网站图片比较多,打开有点慢,怎么一边加载一这显示
- 一个关于ligerui中ligerTree的初始化问题
- 爆菜问题~!
- 请问如何控制textarea输出到html中时显示的字体样式,如颜色字体等,谢谢!
- javascript中的函数可不可以调用其他函数?
- 如何刷新父窗体?
- 50分:我如何在Javascript中取到页面中的两个单选按钮(Radio)的值?
- Js向flex传值,出现undefined is not a function
- 关于jQuery的$ is not defined问题
- 求web的表格控件(类excel)比较成熟的(javascript)
function Test(){
this.temp = 0;
}Test.prototype = {
test: function(){
alert(this.temp);
},
start: function(){
this.temp++;
var self = this;
window.setTimeout(function(){
self.test();
}, 3000);
}
}
var demo = new Test();
demo.start();
function test(){}
test = {
temp:0,
a:function(){
this.temp++;
alert(this.temp);
window.setTimeout("test.a()",500);
}
}
test.a()
楼上的都是牛啊!