JavaScript的执行时间问题
WebService第一次加载的时候通常都很慢,因此我想在这个时候做个Loading的提示,
开始用层的displayed属性来做
document.all("src").style.display="";
//执行WebService
document.all("src").style.display="none";
这样做根本没有效果,没法看出层出现过,且在第一次加载的很长一段时间内也没有出现。
但我用
rs.innerText = "Loading......";
//执行WebService并在rs层上输出
这样就可以达到我想要的效果,也就是WebService加载前可以正常看到loading的提示
那为什么用document.all("src").style.display="";这一句的时候非要等到WebService加载后才能执行呢?