title: When are dynamically created objects inserted into the DOM?
body: <p>I have the following code:</p>
  
  <pre><code>$(function () {
      var html = $('&lt;div&gt;&lt;/div&gt;');
  
      html.load('preview.html', function (responseText, textStatus, XMLHttpRequest) {
          $('#some_id_in_loaded_html')...
      }
  
      html.dialog();
  }
  </code></pre>
  
  <p>However in IE7, the jQuery selector in the callback function fails because it can't find the specified ID. It works fine in Firefox.</p>
  
  <p>Why is this occurring and which is the correct behavior (according to the standards)?</p>
  
  <p>Note that this problem is easily corrected by using <code>$('#some_id_in_loaded_html',this)</code></p>