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());
});
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());
});
load() comes with a callback parameter:
$(document).ready(function() {
$("#first").load("first.php?id="+ Math.random(), {}, function() {
$("#second").load("second.php?id="+ Math.random());
});
});
The {} is for passing an empty object to the data parameter.