jQuery callback not working for load function, not detecting hover events
<p>Using wordpress with atahualpa theme, and I have hyperlinks that reference a simple javascript, that loads the output of a php file into a div. This part works fine.</p>

<pre><code>&lt;a href="javascript:loadCategory(19,1);"&gt;a link&lt;/a&gt;

&lt;script type="text/javascript"&gt;
jQuery("#categoryposts").load("http://www.mysite.com/myphp.php?cat="+catid+"&amp;paged="+pagedid+"", "", 
      function(responseText, textStatus, XMLHttpRequest) {
        if(textStatus == 'error') {
            jQuery('#categoryposts').html('&lt;p&gt;There was an error making the AJAX request&lt;/p&gt;');
        }
      }
  );
  }
&lt;/script&gt;
</code></pre>

<p>But I want to have fun with images (<a href="http://buildinternet.com/2009/03/sliding-boxes-and-captions-with-jquery/" rel="nofollow">sliding boxgrid</a>) that are loaded into div "#categoryposts", however this is where I hit a wall. My php outputs divs with the proper classes but I cannot get any hover response from jQuery at all.  I suspect it is related somehow to the way that the DOM loads but I can't figure it out.  For example, when I try adding the good stuff as a callback function, as below, I do see alert1, but I never get alert2, and the hover function doesn't work.</p>

<pre><code>         function loadCategory(catid,pagedid) {

jQuery("#categoryposts").load("http://www.mysite.com/myphp.php?cat="+catid+"&amp;paged="+pagedid+"", function()
 {  
   alert('alert1');
   jQuery('.boxgrid.caption').hover(function(){ 
       alert('alert2');
       jQuery(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
       }, function(){
        jQuery(".cover", this).stop().animate({top:'220px'},{queue:false,duration:160}); }
  )}, 
      function(responseText, textStatus, XMLHttpRequest) {
        if(textStatus == 'error') {
            jQuery('#categoryposts').html('&lt;p&gt;There was an error making the AJAX request&lt;/p&gt;');
        }
      }
  );

 }
</code></pre>

<p>I've spent an entire day trying to hack through this, trying all sorts of things, but hitting a wall. Hoping a jQuery guru out there can lend a hand.</p>

<p>Edit: cleaned up code formatting</p>
