Mimic Window. onerror in Opera using javascript

后端 未结 4 1746
眼角桃花
眼角桃花 2021-01-17 21:40

I am currently working on a web application, I have a JS logging mechanism that Handles Javascript error that are not caught by the js code inside the page. I am using windo

4条回答
  •  庸人自扰
    2021-01-17 22:15

    This also happens on Safari, AFAIK.

    What you could certainly do is create a global try/catch block for all JS code instead of text parsing - which could be tricky if you come into things like:

    (function ($){
      $(function (){
      });
    })(jQuery);
    

提交回复
热议问题