JavaScript简易错误排查处理

检验是否出错,作用相当于编译
<script type="text/javascript">
	onerror=handleErr;
	var txt="";
	function handleErr(msg,url,l){
		txt+="错误信息:"+msg+"\n";
		txt+="行:"+l+"\n";
		alert(txt);
		return true;
	}

</script>
发布了50 篇原创文章 · 获赞 7 · 访问量 4424

猜你喜欢

转载自blog.csdn.net/qq_37822034/article/details/83870157