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

Java 在jsp页面中调用ajax时加载覆盖,java,jquery,ajax,json,jsp,Java,Jquery,Ajax,Json,Jsp,您好,我想在jsp@center of page中添加一个效果,同时我正在执行一个ajax调用来加载我的下拉列表。如果不看到您的代码,很难回答您的问题。但是有很多方法可以在javascript中生成“加载”掩码。这取决于您拥有哪些javascript库。我将用Ext.LoadMask给出一个示例: // First param of LoadMask constructor is the element to display the load mask over. myMask = new Ex

您好,我想在jsp@center of page中添加一个效果,同时我正在执行一个ajax调用来加载我的下拉列表。

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