禁止网页JS错误

们在浏览某些网页的时候,常常会遇到javascript脚本出错的提示,这些提示能给网站站长修改网页错误时带来方便,了解当前脚本错误在哪。但有的时候我们为了忽略某些细小的错误,就有必要禁止javascript脚本出错提示,具体方法如下:
    只需在网页的<head></head>中间加入如下代码即可禁止javascript脚本出错提示:

<script language=”javascript”>
function killErrors(){
return true;
}
window.onerror = killErrors;
</script>

About 对岸的树

对岸的树。。。。
This entry was posted in web前台开发 and tagged , . Bookmark the permalink.

留下评论

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>