js监听报错页面监听js报错问题

Posted xiaohuizhang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了js监听报错页面监听js报错问题相关的知识,希望对你有一定的参考价值。

<html>
<head>
<script type="text/javascript">
    
// 页面监听js报错问题
onerror=handleErr

var txt=""
function handleErr(msg,url,l)

txt="本页中存在错误如下:\\n\\n"
txt+="错误:" + msg + "\\n"
txt+="URL: " + url + "\\n"
txt+="行:" + l + "\\n\\n"
alert(txt)
console.log(txt)
return true


function message()

addalert("Welcome guest!")
lert("Welcome guest!")

message()
</script>
</head>

<body>
<input type="button" value="查看消息" />
</body>

</html>

 技术图片

 

以上是关于js监听报错页面监听js报错问题的主要内容,如果未能解决你的问题,请参考以下文章