2011-01-06 70 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();