JQERY 和窗口居中

    function del(){
         var checkbox=document.getElementsByName("checkBoxId");
       var j=0;
       var id_list="";
                   for(var i=0;i<checkbox.length;i++){
       if(checkbox[i].checked){
           var value=checkbox[i].value;
           j=j+1;
           id_list+=value+",";
        }
        }
        id_list= id_list.substring(0, id_list.length-1);
        alert(id_list);
        if(j==0){
          alert("你致少应该选择一项");
          return ;
        }
              $.ajax({
                      url:'artDel.do', //后台处理程序
                      type:'get',         //数据发送方式
                      dataType:'json',     //接受数据格式
                      data:{artId:id_list},         //要传递的数据
                      success:su //回传函数(这里是函数名)
                     });
                     }
                     function su(date){
                      if(date.tips=="ok"){
                      alert("删除成功");
                      window.location.href=window.location.href;
                      }else{
                         alert(date.tips);
                        }
                      }
                   //location 显示地址栏 status显示状态栏 有IE7有些功能可能无效
                    function  browse(id){
                      var url="articlebrowse.do?articleId="+id;
                      var iWidth=900; //模态窗口宽度
                       var iHeight=700;//模态窗口高度
                       var iTop=(window.screen.height-iHeight)/2;
                      var iLeft=(window.screen.width-iWidth)/2;
                      window.open(url,"查看文章","width="+iWidth+",height="+iHeight+",top="+iTop+",left="+iLeft+",toolbar=no,menubar=no,scrollbar=yes,resizable=no,location=no,status=no");
                     }

你可能感兴趣的:(窗口居中)