进度微调器
问题描述:
答
具有全局JavaScript函数(如showAjaxWorking()
,hideAjaxWorking()
显示/隐藏包含旋转图像的DIV,定位于标准地点或somehwere具体如果适合。
showAjaxWorking();
dojo.xhrPost({
form: formName,
sync: true,
handleAs: "text",
load: function(response) {
hideAjaxWorking();
successMessage();
} ,
error: function(error, ioargs){
//do something with errors
hideAjaxWorking();
+0
谢谢马克.... – t0mcat 2011-06-15 16:46:37
“负载”函数中的“//微调应该在这里调用”行表明你有一个异步调用的概念问题。 async。“load”和“error”是*回调函数,当任务已经完成时调用这些函数。如果你想用spinner popup/teardown对包装你的异步调用,你必须在**你做异步调用之前把弹出的调用**和回调函数中的拆卸调用放在一起。这被称为连续式编程。 – 2011-06-16 10:05:08