首页 > Web开发 > 详细

js 获取控制台的错误信息

时间:2016-08-27 23:15:56      阅读:799      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<script type="text/javascript">
onerror = function(msg,url,l)
{
    var txt="";
    txt+= msg + "\n";
    txt+= "URL: " + url + "\n";
    txt+= "Line: " + l + "\n\n";
    alert(txt);
}

</script>
</head>

<body>
<input type="button" value="View message" onclick="test()" />
</body>
</html>

 

js 获取控制台的错误信息

原文:http://www.cnblogs.com/CyLee/p/5814016.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!