I found a problem that seems to always play when opening a html and javascript snippet in IE8.
<html> <body> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script> <script> $(document).ready(function(){ $(window).resize(function() { console.log('Handler for .resize() called'); }); }); </script> <div id="log"> </div> </body> </html>
Downloading this file in IE8 and opening the developer tools will show that the log message is printed continuously after a single resizing of the browser window.
Does anyone have an idea why? This does not happen in IE7 or IE9, as well as in other browsers (or at least in their latest versions).
UPDATE
One solution to prevent the resize () trigger from being continuous is to add a handler to document.body.onresize if the browser is IE8.
var ieVersion = getInternetExplorerVersion(); if (ieVersion == 8) { document.body.onresize = function () { }; } else { $(window).resize(function () { }); }
But this does not answer my question: is continuous shooting resize () a bug in IE8?
source share