ajax加载效果设置时间

<script language=javascript>
i=0;
var url;
function showloading(url){
 //alert(url);
 i=i+1;
 if(i<=1){
  $("span1").innerHTML="<img src='images/loading.gif' align='absmiddle'>";
  window.setTimeout("showloading('"+url+"')",3000);
 }else{
  //$("span1").innerHTML="&nbsp;";
 var url =url;
 //var pars ='?fresh='+Math.random();
 var pars =''
 var myAjax = new Ajax.Request(url,{method: 'get', parameters: pars, onComplete: function (originalRequest){
    $("span1").innerHTML=originalRequest.responseText;
 }});
 i=0;
 }
}

function ajax_page(url){
 showloading(url);
 /*var url =url;
 //var pars ='?fresh='+Math.random();
 var pars =''
 var myAjax = new Ajax.Request(url,{method: 'get', parameters: pars, onComplete: function (originalRequest){
    $("span1").innerHTML=originalRequest.responseText;
 }});*/
}

</script>

    A+
发布日期:2010年04月03日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: