How to suppress JavaScript errors

No Comments
  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>

Image Credits: Photo by Isis França on Unsplash.

Last Updated On March 20, 2018

Related Articles

No results found

Leave a Reply

avatar
  Subscribe  
Notify of
Menu
Copy link