IE8 repeatable crash when Javascript updates <img src=...> tag RRS feed

  • 常规讨论

  • While working on developing a small website, I have found a repeatable crash in IE8 which did not happen in IE6/7.  Ideally IE8 could be fixed to behave like IE6/7, but if there is a way I can work around the problem on my end, that's OK, too.

    The problem only occurs if the website contains frames, and inside of one of the frames, Javascript updates the "src" field in an <img ...> tag.  It does not matter if the URL for the image is changing or not.  This problem does not occur if IE8 reads the HTML directly from the hard drive, only if it is served up by an HTTP server.  Here is the simplest form of the code which re-creates the problem:

    File testindex.html:
    <title>Test Page</title>
    <frameset cols="145, 100%">
    	<frame name="menuframe" src="testmenu.html" scrolling=no>
    	<frame name="mainframe" src="testa.html">
    File testmenu.html:
    Menu frame.
    File testa.html:
    <title>Test Page</title>
    <script type="text/javascript">
    var blanklightImg = new Image ();
    blanklightImg.src = "pic/blanklight.bmp" ;
    function BlinkLight()
    	document.myimgname.src = blanklightImg.src;
    	setTimeout ( "BlinkLight();", 20 );
    <BODY onload="BlinkLight();">
    Hello, world!<br />
    Blink Light: <img name=myimgname src="pic/blanklight.bmp"><br />

    After a few minutes, IE8 blinks/restores the page and pops up a notification that "This tab has been recovered."

    After a couple iterations of that, eventually IE8 redirects to a new URL:
    We were unable to return you to the page you were viewing. 
    Internet Explorer has stopped trying to restore this website. It appears that the website continues to have a problem.

    What can be done to fix this?

    2010年1月19日 23:23


  • Hi,

    This is Chinese forum, You may get an answer sooner if you post it in a English forum.

    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support
    2010年1月27日 9:18