【发布时间】:2012-04-25 17:30:10
【问题描述】:
如何设置此功能的等待时间。
function UpdateMedicaitonHistory(data) {
MedicaitonHistoryGrid();
//set a wait time to finish MedicaitonHistoryGrid() like for 3 seconds
// then execute the below code.
if ($("#MedHistoryGridSec").is(":visible")) {
alert("yes we have grid");
}
else{
alert("No Grid");
}
}
【问题讨论】:
-
您不应该向
MedicationHistoryGrid()添加一个回调,它会在它完成时执行,而不是试图猜测它什么时候准备好? -
好吧,它有一个链和依赖项,这不允许我这样做。这就是为什么我选择这种方式保持简单。
标签: javascript jquery time-wait