My website keeps crashing IE, can't debug

前端 未结 5 1338
北海茫月
北海茫月 2021-01-18 02:09

I have a website that suddenly started to crash internet explorer.

The website loads and starts executing javascript but somewhere in there the machinery explodes. I

5条回答
  •  被撕碎了的回忆
    2021-01-18 02:46

    Are you using JSONP in any form? Popular implementations like jQuery tend to try and clean up memory by deleting the script node from the DOM after it has run. I've seen that crash Internet Explorer in many cases. Never could figure out what other conditions needed to be around to cause that to crash. Too much stuff going on in my other pages.

    Anyhow, if you're using jQuery.getJSON, check the following line in jquery source: (line 5556 on jquery 1.4.3):

     } else {
      // Garbage collect
      window[ jsonp ] = undefined;
    
      try {
       delete window[ jsonp ];
      } catch( jsonpError ) {}
     }
    
     if ( head ) {
      head.removeChild( script );
     }
    

    You can safely remove that, or conditionalize it to only happen in non-IE browsers. Hopefully that helps.

提交回复
热议问题