遮盖层1

此脚本通过AJAX调用SocketServletAll.do接口,接收参数并进行处理,显示返回信息后重定向至HjServlet.do?act=retriveall。在请求过程中,实现页面加载时的忙碌提示效果。
  <script type="text/javascript" src="js/jquery-1.2.6.pack.js"></script>
   <script type="text/javascript">
  function refreshAll(){
   showBusy();
   $.ajax({
    type:"POST",
     url:"SocketServletAll.do",
    data: 'aaaaa=2',
    dataType:"json",
     success:function(html){
     var a = html;
      if(html.returnCode =='succ'){
       alert(html.returnMessage);
       window.location.href="HjServlet.do?act=retriveall";
      }else{
       alert(html.returnMessage);
      }
      closeShowBusy();
     },
     error:function(html,testStatus,errorThrown){
      alert("系统繁忙,请重试...."+html);
      alert("错误信息:"+testStatus);
      alert("errorThrown="+errorThrown);
      closeShowBusy();
     }
    }); 
  }
 </script>
  <script type="text/javascript" language="javascript">
 function showBusy(){
  var windowWidth = document.documentElement.clientWidth;
  var windowHeight = document.documentElement.clientHeight;
  var popupHeight = $("#busyBox").height();
  var popupWidth = $("#busyBox").width();
  //centering
  var pTop = $(document).scrollTop();
  var pHeight = $(window).height();
  var itop = pTop+(pHeight/2-popupHeight/2);
  $("#busyBox").css({
   "position": "absolute",
   "top": itop,//windowHeight/2-popupHeight/2,
   "left": windowWidth/2-popupWidth/2
  });
  //only need force for IE6
  var brower = detectBrower();
  if(brower!="Mozilla"){ 
   $("#backgroundPopup").css({
    "width": document.body.clientWidth
   });
   $("#backgroundPopup").css({
    "height": document.body.clientHeight
   });
  }else{
   $("#backgroundPopup").css({
    "height": windowHeight
   });
  }
  $("#backgroundPopup").css({
   "opacity": "0.5"
  });
  $("#backgroundPopup").show();
  $("#busyBox").show();
  //由于select太高,这样控制,别处不用
  $("#chpin").hide();
 }
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值