onreadystatechange 帮我看下这有错吗
<div id="comment_photo" style="margin-left:50px; margin-bottom:10px;">
<iframe src="" id="commentiframe" name="commentiframe" frameborder="0" width="660" style="display:none"></iframe>
<div id="load"><img src="/img/icon/load.gif" /><code> 正在加载留言...</code> </div>
<div style="width:662px; padding:0 0 0px 3px;">{$sTextareaHtml}</div>
</div>
<script type="text/javascript">
var a = document.getElementById("commentiframe");
var b = document.getElementById("load");
a.style.display = "none"; //隐藏
b.style.display = "block"; //显示
a.onreadystatechange = function()
{
var state = this.readyState;
if (state == "loaded" || state == "interactive" || state == "complete")
{
b.innerHTML = "加载完成!";
b.style.display = "none";
a.style.display = "block";
}
}
</script>
为什么有是会出来 有时一直在加载