日期:2014-05-16  浏览次数:20337 次

最简单的用于JS调试代码
只需将以下代码添加到JavaScript脚本最前面
window.onerror=function dealException(msg,url,l){
 txt="错误处理页面\n";
 txt+="错误信息:"+msg+"\n";
 txt+="出错url:"+url+"\n";
 txt+="出错行数:"+l+"\n";
 txt+="点击继续";
 window.alert(txt);
 return true;
}