【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>

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM