2011-01-06 41 views

回答

1

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