How to suppress JavaScript errors

H

How Can We Help?

  1. Create a JavaScript function called suppressJS()
    function suppressJS(){return true;}
  2. Then within the head tags add the following code
    window.onerror=suppressJS;
  3. Your complete code will look like this
    <script type="text/javascript">
     
    <!--
     
    function suppressJS(){return true;}
     
    window.onerror=suppressJS;
     
    //-->
     
    </script>

About the author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

About Author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

Follow Me