在Exception没有被catch的情况下,如何避免IE处理脚本错误?
wsj 2003-04-04 11:11:04 <HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<script>
window.onerror = function(s,u,l){
try
{
alert(u+"中\n\n"+l+"行\n\n发生了错误:"+s);
}catch(e){}
//try to avoid IE handle it.
event.cancelBubble = true;
event.returnValue = false;
return false;
//but no work
}
</script>
<BODY onclick="asdf">
<!--BODY onclick="throw 'exception not catched'"-->
<P> </P>
</BODY>
</HTML>