5秒后如何调用FB函数调用FA后,花5秒调用FB运行function FA() { $.ajax({ ... success: function() { //do stuff } });}function FB() { $.ajax({ ... success: function() { //do stuff } });}
1 回答
暮色呼如
TA贡献1853条经验 获得超9个赞
用途setTimeout(function, ms):
function FA() {
console.log("FA called");
setTimeout(FB, 5000); //5000 milliseconds
}
function FB() {
console.log("FB called");
}
<button onclick="FA()">Start</button>
添加回答
举报
0/150
提交
取消