---
title: "JQERY 和窗口居中"
author: "rainyear"
date: "2011-09-07T10:30:23Z"
tags: []
categories: ["非技术"]
slug: "jqery"
draft: false
lastmod: "2011-09-07T10:30:23Z"
id: 1167295
url: "https://rainyear.iteye.com/blog/1167295"
---

function del(){
  			       var checkbox=document.getElementsByName("checkBoxId");
 			       var j=0;
 			       var id_list="";
                   for(var i=0;i<checkbox.length;i++){
 			       if(checkbox*.checked){
 			           var value=checkbox*.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");
                     }