jquery,等待完成

jquery,等待完成,jquery,Jquery,如何仅在第一个函数将在中完成时运行第二个函数 $(document).ready(function() { $("#first").load("first.php?id="+ Math.random()); $("#second").load("second.php?id="+ Math.random()); }); load()附带一个回调参数: $(document).ready(function() { $("#first").load("first.php?id="+ Math.

如何仅在第一个函数将在中完成时运行第二个函数

$(document).ready(function() {
 $("#first").load("first.php?id="+ Math.random());
 $("#second").load("second.php?id="+ Math.random());
});
load()
附带一个回调参数:

$(document).ready(function() {
 $("#first").load("first.php?id="+ Math.random(), {}, function() {
  $("#second").load("second.php?id="+ Math.random());
 });
});
{}
用于将空对象传递给
数据
参数