jQuery - .load(load) having problem load content after another loaded content
<p>I am using Jquery load and then as soon as the content is loaded into the div i load another content from the new one. My problem is that the "prec3" wont load. How can I do? Probably using settimeout?</p>

<pre><code>$(document).ready(function(){
var filtralink = $('.blockhead a').filter('a[href^="http://site.com/photo/showgallery.php?cat="]').attr('href').split(/=/)[1];                                      
var primaimmagine = $('.forumrow table').find('img:first').attr('src').split(/medium/)[1];
var fotothumb = "http://site.com/photo/data/" + filtralink + "/thumbs" + primaimmagine;
fotothumbdarip =fotothumb;

$('body').prepend('&lt;br /&gt;&lt;div id="precunz" class="precunz" name="precunz"&gt;&lt;/div&gt;&lt;div id="precduz" class="precduz" name="precduz"&gt;&lt;/div&gt;&lt;div id="prectruz" class="prectruz" name="prectruz"&gt;&lt;/div&gt;');

 $('div[align=center]:eq(1)').append('&lt;br /&gt;&lt;ul id="categories"&gt;&lt;li&gt;&lt;a href="#load"&gt;load&lt;/a&gt;&lt;/li&gt;&lt;div class="dropdown"&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="#show"&gt;Show&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/ul&gt;&lt;div id="precun" class="precun" name="precun"&gt;&lt;/div&gt;&lt;div id="precdu" class="precdu" name="precdu"&gt;&lt;/div&gt;');

$(".precunz,.precduz,.prectruz").hide();    

var prec1 = $(".forumrow table").find('a').filter(':contains(previous)').attr('href');
prec1darip =prec1;

var prec1cat1split =  $('.blockhead a').filter('a[href^="http://site.com/photo/showgallery.php?cat="]').attr('href').split(/=/)[1];

$(".precunz").load(prec1+" ol.floatcontainer");

$('#categories &gt; div').hide();

var $listHeader = $('#categories &gt; li');
$listHeader.live("click" ,function(event) {
event.preventDefault();
$('#categories &gt; div').toggle();

var prec2 = $(".precunz .forumrow table").find('a').filter(':contains(previous)').attr('href');
  prec2darip=prec2;
  var prec2cat1split =  $('.blockhead a').filter('a[href^="http://site.com/photo/showgallery.php?cat="]').attr('href').split(/=/)[1];
prec2cat1splitdarip = prec2cat1split;
 var prec2immgran = $('.precunz .forumrow table').find('img:first').attr('src').split(/medium/)[1];
  prec2immgrandarip = prec2immgran;
$(".precduz").load(prec2+" ol.floatcontainer"); 

/// This prec3 can't load     
var prec3 = $(".precduz .forumrow table").find('a').filter(':contains(previous)').attr('href');
prec3darip=prec3;
var prec3cat1split =  $('.blockhead a').filter('a[href^="http://site.com/photo/showgallery.php?cat="]').attr('href').split(/=/)[1];
prec3cat1splitdarip = prec3cat1split;
var prec3immgran = $('.precduz .forumrow table').find('img:first').attr('src').split(/medium/)[1];
prec3immgrandarip = prec3immgran;
$(".prectruz").load(prec3+" ol.floatcontainer");
});

$('#categories &gt; div a').click(function() {
    $('#categories &gt; div').hide();
    $(this).prependTo('#categories &gt; li');
    $('#categories &gt; li &gt; a:eq(1)').prependTo('#categories &gt; div &gt; ul &gt; li:empty');
    $listHeader = $('#categories &gt; li');
var prec1immgran = $('.precunz .forumrow table').find('img:first').attr('src').split(/medium/)[1];
var prec1th = "http://site.com/photo/data/" + prec1cat1split + "/thumbs" + prec1immgran;
$('.precun').append('&lt;a href="' +prec1+ '"&gt;&lt;img src="' +prec1th+ '" alt="" /&gt;');

var prec2immgran = $('.precduz .forumrow table').find('img:first').attr('src').split(/medium/)[1];
prec2th = "http://site.com/photo/data/" + prec2cat1splitdarip + "/thumbs" + prec2immgran;
$('.precun').append('&lt;a href="' +prec2darip+ '"&gt;&lt;img src="' +prec2th+ '" alt="" /&gt;&lt;/a&gt;');

/// this wont work because prec3 is not there
var prec3immgran = $('.prectruz .forumrow table').find('img:first').attr('src').split(/medium/)[1];
var prec3th = "http://site.com/photo/data/" + prec3cat1splitdarip + "/thumbs" + prec3immgran;
$('.precun').append('&lt;a href="' +prec3darip+ '"&gt;&lt;img src="' +prec3th+ '" alt="" /&gt;&lt;/a&gt;');

$('.precun').append('&lt;a href="' +$(location).attr('href')+ '"&gt;&lt;img src="' +fotothumbdarip+ '" alt="" /&gt;');
return false;

});

});
</code></pre>
