页面上<body>开始的地方显示一个div
<body>结束的地方把div隐藏这样就在页面加载的时候显示loading图片了apache上可以
IIS上进入页面时没任何反应, 等一会就一下把所有内容都显示出来了 包括一闪而过的loading 和页面IIS是吧所有内容都处理完 一起发送给IE么?
怎么改才能让IIS和apache一样显示loading啊 求助
<body>结束的地方把div隐藏这样就在页面加载的时候显示loading图片了apache上可以
IIS上进入页面时没任何反应, 等一会就一下把所有内容都显示出来了 包括一闪而过的loading 和页面IIS是吧所有内容都处理完 一起发送给IE么?
怎么改才能让IIS和apache一样显示loading啊 求助
回楼上兄弟 现在就是js处理的
<script language="javascript" charset="utf-8">
// loading bar
function loading_start()
{
var ct_left = (parseInt(screen.width) - 700) / 2; //450
var ct_top = (parseInt(screen.height)) / 6; //4
layer_str = "<div id='loading_layer' style='position:absolute; background-color:; font-size:12px; left:" + ct_left + "px; top:" + ct_top + "px; width:400px; height:; padding:50px; text-align:center; vertical-align:middle; z-index:1000;display:block;'>"
layer_str += 'Loading....'
layer_str += "</div>"
document.write(layer_str);
}loading_start();
。。这些都是在body最前面的, 但是IIS上就是不能在处理完成前先显示出来
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>AJAX实现Loading效果的方法-HTMer</title></head>
<body>
<div id="show"></div>
<script language="javascript" type="text/javascript">
var xmlHttp;
//创建xmlHttpRequest对象
function createXMLHttpRequest(){
if(window.ActiveXObject)
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); //兼容IE浏览器
else if(window.XMLHttpRequest)
xmlHttp=new XMLHttpRequest(); //兼容Firefox浏览器
}
function htmer_loading(){
createXMLHttpRequest();
xmlHttp.onreadystatechange=function(){
// if(xmlHttp.readyState==4&&xmlHttp.status==200)
// document.getElementById("show").innerHTML=xmlHttp.responseText; //若响应完成,则显示htmer.asp中的内容
// else
document.getElementById("show").innerHTML="<div align='center'><img src='images/loading.gif' /> Loading......</div>"; //若响应未完成,则显示Loading
}
xmlHttp.open("GET","htmer.php",true);
xmlHttp.send(null);
}
htmer_loading();
</script>
<?
for ($i = 0; $i < 50000000; $i++) {
if($i == 49999999)
echo $i;
} ?>
</body>
</html>是像这样的么? 试了 也是不行额 IIS里面loading和4999999同时显示, apache里可以先出现loading 然后运行完了出现499999
难道是我的IIS设置有问题么?
这个在IIS上得用页面显示Loading 然后异步加载页面要现实的内容是吧,因为IIS是加载完整体发送页面 要是加载内容的时候用ajax控制Loading根本显示不出来