⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 13.4 错误处理与error对象3.html

📁 javascript即用即差核心对象手册
💻 HTML
字号:
<body>
<table id="info" cellpadding=1 cellspacing=1>
   <tr><td colspan="2"  align="center" bgcolor="#CCCCCC">有错误发生了</td></tr>
   <tr>
       <td bgcolor="#CCCCCC">错误编号</td>
	   <td></td>
   </tr>
   <tr>
       <td bgcolor="#CCCCCC">错误名称</td>
	   <td></td>
   </tr>
   <tr>
       <td bgcolor="#CCCCCC">错误说明</td>
	   <td></td>
   </tr>
   <tr>
       <td bgcolor="#CCCCCC">错误信息</td>
	   <td></td>
   </tr>
</table>
<script>
   try
   {
      var num=eval("av");
   }
   catch(err)
   {
	  writeErrorInfo(err);
   }
   function writeErrorInfo(err)
   {
       with(document)
	   {
           getElementById("info").rows(1).cells(1).innerText=err.number;
		   getElementById("info").rows(2).cells(1).innerText=err.name;
		   getElementById("info").rows(3).cells(1).innerText=err.description;
		   getElementById("info").rows(4).cells(1).innerText=err.message;
	   }
   }
</script>
</body>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -