日期:2014-05-17  浏览次数:20805 次

求一段javascript代码!
HTML code
<%@ page language="java" contentType="text/html; charset=UTF-8"      
    pageEncoding="UTF-8"  import="java.util.*,java.lang.*,java.lang.Iterable.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>图籍查询</title>
 
    <%
    String str[][]=(String[][])request.getAttribute("tujijieguo"); //显示数组
    String str1[][]=new String[str[0].length][str.length];     //查询框
    
     
         for(int i=0; i<str[0].length;i++)                              //查询框赋值,将数组转向
        {
            for(int j=0;j<str.length;j++)                            
            {
       
                str1[i][j]=str[j][i];
            }
        }
         HashSet<String> set=new HashSet<String>();                 
            
         int z=0;
        String s1[][]=new String[str1.length][str1[0].length];
        String s="";
                
        for(int i=0;i<str1.length;i++)                              
        {
            z=0;
            for(int j=0;j<str1[0].length;j++)
            {
                set.add(str1[i][j]);                                  //通过循环 去掉重复项目
            }
            
            Iterator<String> inter =set.iterator();                      //定义对象并且赋值 
            
            while(inter.hasNext())
            {
                 s =(String)inter.next();
                 s1[i][z]=s;
                 z++;
            }
        
            set.clear();
        }
      
        int a []={3,4,5,7,9,10},k;
        
    
           if(str.length%10==0)
               k=str.length/10;
           else
               k=str.length/10+1;
  
   
    %>
 <script type="text/javascript">   

     function reserveCheck(id)
     {   
        var ids = document.getElementsByName(id);   
        var len = ids.length;   
        if (len > 0) 
        {   
             var i = 0;   
             for (i = 0; i < len; i++) 
             {   
               if (ids[i].checked) 
                    ids[i].checked = false;   
                 else 
                     ids[i].checked = true;   
 
             }   
         }   
     }
     function rx(id)
     {   
        var ids = document.getElementsByName(id);   
        var len = ids.length;   
        if (len > 0) 
        {   
             var i = 0;   
             for (i = 0; i < len; i++) 
             {   
           
                    ids[i].checked = true;   
             }   
         }   
     }
     function rq(id)
     {   
        var ids = document.getElementsByName(id);   
        var len = ids.length;   
        if (len > 0) 
        {   
             var i = 0;   
             for (i = 0; i < len; i++) 
             {   
           
                    ids[i].checked = false;   
             }   
         }   
     }
         
  </script>   
   <style>
form {
    margin:0px;
    padding:0px;
}
</style>
   
</head>
<body>
<form action="./Tuji?leibie=tujichaxun" method="post" >
<table width="740"  border="1" align="center" STYLE="table-layout: fixed"  class="selectDiv" >
<tr>
    <td width="10%">图纸编号</td>
    <td width="10%">专业</td>
    <td width="15%">设计名称</td>
    <td width="10%">图号</td>
    <td width="20%">名称</td>
    <td width="10%">现存数</td>
    <td width="8%">存放位置</td>
    <td width="21