【发布时间】:2011-06-04 17:35:05
【问题描述】:
您好,当我执行 ajax 调用以加载我的下拉列表时,我想在 jsp @ center of page 添加一个效果。
【问题讨论】:
您好,当我执行 ajax 调用以加载我的下拉列表时,我想在 jsp @ center of page 添加一个效果。
【问题讨论】:
不看代码就很难回答你的问题。但是有很多方法可以在 javascript 中生成“加载”掩码。这取决于您拥有哪些 javascript 库。我将举一个 Ext.LoadMask 的例子:
// First param of LoadMask constructor is the element to display the load mask over.
myMask = new Ext.LoadMask(Ext.getBody(), {
msg:"Please wait..."
});
myMask.show();
// Perform ajax call to load data ... something like
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
// Your code populates the dropdown with the response ...
// Then hide the mask when data is loaded
myMask.hide();
}
}
xmlhttp.open("GET","http://myurl/data",true);
xmlhttp.send();
【讨论】: