gpt4 book ai didi

java - 在jsp页面中调用ajax时加载覆盖

转载 作者:行者123 更新时间:2023-12-01 15:58:11 24 4
gpt4 key购买 nike

您好,我想在执行 ajax 调用以加载下拉列表时在 jsp @ 页面中心添加效果。

最佳答案

如果没有看到您的代码,很难回答您的问题。但是有多种方法可以在 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();

关于java - 在jsp页面中调用ajax时加载覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4616568/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com