直接写到页面里正常
- VBScript code
Response.Buffer = True For i = 0 To 100 Response.Write Now() Response.Flush Call wite 1000 Next
如果使用js的innerHTML间接写到页面里,则要循环结束后才能一次性写入(即失去缓冲区写入效果)
- VBScript code
Response.Buffer = True For i = 0 To 100 temp = temp & "<br />" & Now() Response.Write "<script type='text/javascript'>document.getElementById('Test').innerHTML = '" & temp & "';</script>" Response.Flush Call wite 1000 Next
- HTML code
<div id="Test">载入ing...</div>
请问谁知道如何才能解决?
------解决方案--------------------
将Response.Write "<script type='text/javascript'>document.getElementById('Test').innerHTML = '" & temp & "';</script>"
Response.Flush
代码放入<body></body>之中,可能是尚未加载,所以无效。