title: JQuery UI Dialog Slow to Load in IE8 (Loads quickly the first time)
body: <p>I know IE javascript performance is abysmal compared to FF and Chrome, but most of my users us IE8. I don't notice the performance problem in FF (surprise). I am using Jquery and Jquery-ui for the dialog functionality. </p>
  
  <p>Basically, I have a large number of links that I load into a dialog box using ajax. The first time I click the button to bring up the dialog box it loads very quickly (~0.1s). However, when I close the dialog and bring it up again it takes a significantly longer time to show up. </p>
  
  <p>The database and ajax calls are not the problem. The data is appended to the dialog box and I use simple logic to make sure that function isn't called again. Subsequent attempts to open the dialog box <em>should</em> be quicker.</p>
  
  <p>Using IE8's profiler I noticed that there are tens of thousands of calls to:</p>
  
  <blockquote>
  <pre><code>"hidden"
  "curCSS"
  "JScript - window script block"
  </code></pre>
  </blockquote>
  
  <p>These function calls don't come up the first time I open the dialog. I'm at a loss for a reason why.</p>
  
  <p>Clearly, there isn't any scripting taking place on the individual elements within the dialog the first time it's loaded, but why would this change on subsequent calls?</p>
  
  <p>Some code:</p>
  
  <p>$(document).ready(function () {</p>
  
  <pre><code>$("#dialog").dialog({
      autoOpen: false,
      resizable: false,
      draggable: false,
      closeText: "",
      width: "auto",
      dialogClass: "ddx",
  });
  
  
  $("#button").click(function (e) {
      e.preventDefault();
  
      //Check if "this" is empty, if not, data is already loaded
      if ($.trim($("#dialog").html()).length &gt; 0) {
          $("#dialog").dialog("open");
      }
      else {
  
          $.ajax({
              url: baseUrl,
              dataType: "text",
              success: function (data) {
                  $("#dialog").append(data);
  
              }
          }); 
          $("#dialog").dialog("open");
      }
  }); 
  }); 
  </code></pre>
  
  <p>html in the body:</p>
  
  <p><code>&lt;div id="dialog" title="Test Dialog" class="ddx"&gt;&lt;/div&gt;</code></p>
  
  <p>The dialog ends up containing several levels of nested lists with hundreds of li's.</p>