新闻详情

打印页面如何报错 js

2894 2009/5/15

打印页面出错的原因

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>标题页</title>
<script language="javascript">
function getError()
{
    try
    {
     x =new test;                        //产生错误。
    }
    catch(e)
    {
       document.write(e.description)     //打印错误结果.
    }
}
</script>
</head>
<body onLoad="getError()" >
</body>
</html>

相关资讯

18973218026
返回顶部