zoukankan      html  css  js  c++  java
  • JS隐藏错误

    <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>
  • 相关阅读:
    Matplotlib.pyplot 三维绘图
    Matplotlib.pyplot 二维绘图
    面对对象进阶
    面对对象基础
    python安装第三方模块
    json & pickle
    os模块
    sys模块
    正则表达式
    Python2与Python3的编码差异
  • 原文地址:https://www.cnblogs.com/luqingfei/p/495213.html
Copyright © 2011-2022 走看看