How do I  run a function only when a div gets loaded?
<p>I want to run a function only when a div gets loaded.</p>

<p>When I load the page, a number of files are loaded. At the end of the list, PHP echoes a div. When this one is displayed, jQuery should run a function.</p>

<p>I can do this with a click-event, but I want it to work automatically, without pushing a button.</p>

<p>This is how it works with a click:</p>

<pre><code>$("#PP_end_show").live("click",function(){
    $("#PP_head_bar").slideToggle("slow");
    $("#PP_info_file_wrap").slideUp("slow");
}); 
</code></pre>

<p>This is the <code>div</code> echoed by PHP:</p>

<pre><code> &lt;?php echo "&lt;div id=\"PP_end_show\"&gt;&lt;/div&gt;"; ?&gt;
</code></pre>

<p>The output is generated after an AJAX call:</p>

<pre><code>&lt;form id="PP_search_input" method="post" name="search_ID" ONSubmit="xmlhttpPost('PP_search_stream_client.php', 'PP_search_input', 'PP_thumb_output', '&lt;img src=\'images/wait.gif\'&gt;');return false;  "&gt;
        &lt;input name="search_string" type="text" class="PP_input" id="search_string" value="&lt;?php echo $_POST['search_string']; ?&gt;"/&gt;
        &lt;button type="submit" class="PP_submit" id="search_submit"&gt; search &lt;/button&gt;
</code></pre>

<p>at the end of the generated output the specific div will be printed and should trigger the new jQuery function.</p>
