转载请注明来源:https://www.cnblogs.com/hookjc/

<html>
<head>
<script type="text/javascript">
onerror=handleErr
var txt=""
function handleErr(msg,url,l)
{
txt="There was an error on this page.\n\n"
txt+="Error: " + msg + "\n"
txt+="URL: " + url + "\n"
txt+="Line: " + l + "\n\n"
txt+="Click OK to continue.\n\n"
alert(txt)
return true
}
function message()
{
adddlert("Welcome guest!")
}
</script>
</head>
<body>
<input type="button" value="View message" onclick="message()" />
</body>
</html>

注:当点击按钮时出现错误,则触发onerror事件 即onerror=handleErr    去执行handleErr方法,msg为错误信息,url为当前显示的url地址,l表示错误的行号

来源:python脚本自动迁移

最新文章

  1. sql字段属性
  2. jq异步上传文件(转载)
  3. Result Maps collection does not contain value for java.lang.Integer异常处理
  4. C++学习13 类class和结构体struct的区别
  5. windows通过thrift访问hdfs
  6. Ubuntu 12.04 和 Win7 双系统安装
  7. Linux下glui 的安装,以及错误解决
  8. 大话设计模式之策略模式(strategy)
  9. 说说SACC2016第八届架构师大会
  10. jQuery实践-别踩白块儿网页版
  11. ios播放音乐
  12. 从CentOS安装完成到生成词云python学习日记
  13. python 视频转成代码视频
  14. JSONP方法简单封装
  15. type-of-python作业-判断字符串是否属于回文需要忽略其中的标点、空格与大小写
  16. 分布式 基本理论 CAP
  17. 学习2__STM32--汉字显示
  18. Codeforces 138C Mushroom Gnomes - 2 线段树
  19. 请教神牛_字符串hash
  20. bit,Byte,Word,DWORD(DOUBLE WORD,DW)

热门文章

  1. 计算机系统2-&gt;从芯片说起 | 芯片怎样诞生
  2. &lt;学习opencv&gt;图像变换
  3. 最简短的 AC 自动机!
  4. Lomsat gelral
  5. kubernetes 之部署metrics-server
  6. navicat 找不到系统路径 【修改了系统路径中文名称引起的】
  7. linux如何查看服务器当前的并发访问量
  8. linux tomcat【9.0.12】 使用 ssl证书 配置 https 的具体操作 【使用 域名 】
  9. 第10组 Beta冲刺 (5/5)(组长)
  10. Calendar日期往后一天,一月等