title: Equivalent of .ready() for a div?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3384398/how-to-detect-new-element-creation-in-jquery">How to detect new element creation in jQuery?</a>  </p>
  </blockquote>
  
  
  
  <p>I have a page, which has several divs that are created by a different jQuery call. Once these divs are created, I want to make an ajax call to load some html into them. I have tried something like this (coffeescript):</p>
  
  <pre><code>$("#myDiv").ready -&gt;
    alert "div ready"
  </code></pre>
  
  <p>but because the .ready function is only defined for a document, this runs immediately upon page load (before the div exists). I also tried this:</p>
  
  <pre><code>$("#splunk_results").ready -&gt;
    $("#splunk_results").each -&gt;
      alert "div ready"
  </code></pre>
  
  <p>as per the selected answer <a href="https://stackoverflow.com/questions/2816623/jquery-ready-fires-on-div-tag-not-in-the-page">here</a>, but this seems to not load at all.</p>
  
  <p>Basically, is there a simple way to execute code when a div appears?</p>