情缘 2008-05-24 10:56
<script type="text/javascript">
function Hello(name){this.name = name;}
Hello.prototype.Start = function(){
setTimeout(this.GetShow(this),3000);
}
Hello.prototype.Show = function(){alert(this.name);}
Hello.prototype.GetShow = function(variable){
return function()
{
variable.Show();
}
}
var hello = new Hello("robot");
hello.Start();
hello.name = "robot1";
</script>
博主的文章很不错,我还是有点不明白,将setTimeout(this.GetShow(this),3000); 改为setTimeout(this.Show(this),3000); 结果为什么不一样,请博主指点一下.