response.flush在IE8下不好使,在chrome和FF下OK
代码如下:
private void Page_Load(object sender, EventArgs e)
{
Response.Write("<div id='mydiv' >");
Response.Write("_");
Response.Write("</div>");
Response.Write("<script type=\"text/javascript\">mydiv.innerText = '';</script>");
Response.Write("<script type=\"text/javascript\">;");
Response.Write("var dots = 0;var dotmax = 10;function ShowWait()");
Response.Write("{var output; output = 'Loading';dots++;if(dots>=dotmax)dots=1;");
Response.Write("for(var x = 0;x < dots;x++){output += '.';}mydiv.innerText = output;}");
Response.Write("function StartShowWait(){mydiv.style.visibility = 'visible'; window.setInterval('ShowWait()',1000);}");
Response.Write("function HideWait(){mydiv.style.visibility = 'hidden';window.clearInterval();}");
Response.Write("StartShowWait();</script>");
Response.Flush();
Thread.Sleep(5000) ;
}
代码是网上找到,关键是这个东西在chrome和FF下OK,我电脑装的是IE8,IE就不行,不知道是需要改什么吗?