大家帮忙看看一个小程序啊!! 但是我把window.onerror="errhandle()";这一句注释掉,程序也能运行通过啊~` 那这句不是多余了吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 那当程序有错误产生时,window.onerror="errhandle()"中的errhandle()函数是怎么执行的呢? 或者说它执行的结果是什么啊? <body><img name="img1" src="http://community.csdn.net/images/csdn.gif" style="position:absolute;filter:alpha(opacity=0);"></body><script language=javascript>function fade(o){ this.obj = o; this.offset=5; this.timer = null; this.act = "in"; this.action= function(){ //alert(this.obj.tagName); var curOpacity = this.obj.filters.alpha.opacity; if( this.act == "out" ) { if(curOpacity > 0) { this.obj.filters.alpha.opacity-=this.offset; } else { this.act = "in"; this.obj.style.left= Math.random()*800 + "px"; this.obj.style.top = Math.random()*600 + "px"; } } else { if(curOpacity<100) { this.obj.filters.alpha.opacity+=this.offset; } else { this.act = "out"; } } }; this.play = function(){ var self=this; var f = function(){self.action()}; this.timer=setInterval(f,40); }; this.stop = function(){ if(this.timer) clearInterval( this.timer ); };}var m1 = document.images[0];var f1 = new fade(m1);f1.play();</script> 贴错了。--------------------------------那当程序有错误产生时,window.onerror="errhandle()"中的errhandle()函数是怎么执行的呢?或者说它执行的结果是什么啊?---------------------------------一般来说可以在调试的时候提示一些信息,或者其它一些的处理 求教 [紧急求助]js对iframe加载的影响 怎么在没有安全提示的情况下得到file域中文件的大小 如何用javascript建一个浮动层? 提供试听的音乐,怎样才能有效地防止用户下载 求助:jsp文件如何从html中读取数据 判断一个网页是否包含在框架里面怎么写?thkS [求救]关于提交openwindow类型! javascrip的问题,高手快来帮我解决一下,谢谢了 如何屏蔽? 在BODY ONLOAD问题 我写的VML会被瑞星个人防火墙挡住!
或者说它执行的结果是什么啊?
<img name="img1" src="http://community.csdn.net/images/csdn.gif" style="position:absolute;filter:alpha(opacity=0);">
</body>
<script language=javascript>
function fade(o){
this.obj = o;
this.offset=5;
this.timer = null;
this.act = "in";
this.action= function(){
//alert(this.obj.tagName);
var curOpacity = this.obj.filters.alpha.opacity;
if( this.act == "out" )
{
if(curOpacity > 0)
{
this.obj.filters.alpha.opacity-=this.offset;
}
else
{
this.act = "in";
this.obj.style.left= Math.random()*800 + "px";
this.obj.style.top = Math.random()*600 + "px";
}
}
else
{
if(curOpacity<100)
{
this.obj.filters.alpha.opacity+=this.offset;
}
else
{
this.act = "out";
}
}
};
this.play = function(){
var self=this;
var f = function(){self.action()};
this.timer=setInterval(f,40);
};
this.stop = function(){
if(this.timer) clearInterval( this.timer );
};
}
var m1 = document.images[0];
var f1 = new fade(m1);
f1.play();
</script>
--------------------------------那当程序有错误产生时,window.onerror="errhandle()"中的errhandle()函数是怎么执行的呢?
或者说它执行的结果是什么啊?
---------------------------------
一般来说可以在调试的时候提示一些信息,或者其它一些的处理