<script language="JavaScript">
<!-- Hide
function killErrors() {
return true;
}
window.onerror =killErrors;
// -->
</script>
这样在状态栏下就不会出现错误提示了~...
Demo
1<html>
2<head>
3<title>隐藏错误</title>
4<script language="javascript">
5<!--Hide
6 function killErrors()
7 {
8 return true;
9 //alert("有错误喽!");
10 }
11
12 window.onerror=killErrors;
13-->
14</script>
15</head>
16<body>
17<input type="text" name="txt1"><br/>
18<input type="button" name="btn1" value="OK" onclick="ChangeTitle();">
19</body>
20<script language="javascript">
21 document.title = "Javascript 隐藏错误";
22 document.getElementById("txt12").value = "test";
23
24 function ChangeTitle()
25 {
26 document.title = document.getElementById("txt1").value;
27 }
28</script>
29</html>
2<head>
3<title>隐藏错误</title>
4<script language="javascript">
5<!--Hide
6 function killErrors()
7 {
8 return true;
9 //alert("有错误喽!");
10 }
11
12 window.onerror=killErrors;
13-->
14</script>
15</head>
16<body>
17<input type="text" name="txt1"><br/>
18<input type="button" name="btn1" value="OK" onclick="ChangeTitle();">
19</body>
20<script language="javascript">
21 document.title = "Javascript 隐藏错误";
22 document.getElementById("txt12").value = "test";
23
24 function ChangeTitle()
25 {
26 document.title = document.getElementById("txt1").value;
27 }
28</script>
29</html>