Hi,

how to run the second function only when the first will be completed in?

$(document).ready(function() {
 $("#first").load("first.php?id="+ Math.random());
 $("#second").load("second.php?id="+ Math.random());
});
$(document).ready(function() {
  $("#first").load("first.php?id="+ Math.random(), function(){
    $("#second").load("second.php?id="+ Math.random());
  });
});
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.