title: Why does IE8 hangs on jquery window.resize event?
body: <p>I discovered a problem that seems to reproduce always when opening a piece of html and javascript in IE8.</p>
  
  <pre><code>&lt;html&gt;
      &lt;body&gt;
      &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script&gt;
          $(document).ready(function(){
              $(window).resize(function() {
                  console.log('Handler for .resize() called');
              });
          });
      &lt;/script&gt;
      &lt;div id="log"&gt;
      &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Loading this file in IE8 and opening Developer Tools will show that the log message is printed continuously after one resize of the browser window.</p>
  
  <p>Does anyone has an idea why? This is not happening in IE7 or IE9, nor in other browsers (or at least their latest versions).</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>One solution to prevent the continuos trigger of resize() is to add handler on document.body.onresize if the browser is IE8.</p>
  
  <pre><code> var ieVersion = getInternetExplorerVersion();
      if (ieVersion == 8) {
          document.body.onresize = function () {
          };
      }
      else {
          $(window).resize(function () {
          });
      }
  </code></pre>
  
  <p>But this does not answer my question: is the continuous firing of resize() a bug in IE8?</p>