onclick="address2(${n})"  能把第几条传给javascript里的faction address2()  获得点击的是第几条数据

解决方案 »

  1.   

    <a href="XXX.jsp?stuName=${stu.stuName}&stumanager=${stu.manager}&studepartment=${stu.department}&stuId=${stu.id}" class="edit">xxx</a>
    另一个页面就可以获取到了
      

  2.   


    失败了,我还忘了说了 之前那个jsp并没关闭, 点那个jsp上的按纽查询 后 弹出了一个窗口的jsp,从这个窗口的jsp上选地址超链接点击,这个小窗口关闭,选的地址传到了之前那个jsp上了
      

  3.   

    点击超链接不跳转到另一个页面吗?怎么还要将信息传到前一个jsp页面啊?
      

  4.   


    我叙述的有问题  不是跳转  是关闭   前一个jsp上点击查询按纽后, 会弹出一个窗口形式的jsp,上面很多地址 点击一个超链接地址,窗口的jsp关闭,点击的地址传到前一个jsp上
      

  5.   

    opener
      

  6.   

    我用ajax+layer可以实现过你的要求。不过不是页面传页面
      

  7.   

    不知道你的弹出框用的是什么方式 我们项目中这样的弹出框都是这样处理的
    用window.showModalDialog打开对话框
    window.returnValue从打开的对话框返回值
    你可以 试试看
      

  8.   

    说的有点简单 说详细下 主要操作都是 js的处理点击事件的function
    //return用来接受弹出对话框的数据
    var return = window.showModalDialog(url,window,sFeatures);
    if(return!=null){
    //这里处理返回过来的数据
    }弹出框的js
    window.returnValue = 直接写要返回的数据 一般用json;
    window.clos();
      

  9.   

    其实就是JS处理。跟JAVA没什么关系。
      

  10.   

    给你说下我这边的具体情况吧  愁死了
    主jsp 为A.jsp  上面有查询按纽,点击,走action,返回后是回到一个隐藏的jsp,B.jsp  .
    b.jsp里只有js,各种方法,body内容如下
    <body onload="init();">
    <form></form>
    </body>
    就是通过这个隐藏的b.jsp里的js方法处理查到的存在request里的数据,把这数据赋到a.jsp
    我是现在要求检索数据时,如果是多条数据,需要弹出一个窗口c.jsp
     window.open("./SearchZip.do?zip="+zipCode, "window_name", "width=780,height=350,scrollbars=yes,resizable=yes,statux=yes");
    我把这句话放到了b.jsp里的js里的方法里调用
    在走一个action后,把查询到的多条数据显示在c.jsp上,a.jsp还开着,c.jsp是以小窗口的形式开着的,
    点击c.jsp里的数据超链接,把对应数据赋到a.jsp上
    我本来查到了方法
    window.opener.document.getElementById("AddressCity").value  = "";
    这个方法可以赋值给主体jsp里,可惜 我中间有一个隐藏的b.jsp抢了主体jsp的位置,最终数据就传不到a.jsp上了
      

  11.   


    这个超级链接,差点就有用了,结果我目前系统的古怪用不上
    window.opener.document.getElementById("AddressCity").value  = "";
    愁死了
      

  12.   

    地址链接传参数、或request、
      

  13.   

    根據11樓說的
    c.jsp 的js裡
    function search1(n){ 
    if(n.toString().length==1){
       var code = '0' + n;
    }else{
       var code = n;
    }
           if(window.opener) { 
                 fWindowText1 = window.opener.document.getElementById("Address1"); 
                 fWindowText1.value = code; 
                  
                 fWindowText2 = window.opener.document.getElementById("Address2"); 
                 fWindowText2.value = code; 
                  
                  window.close(); 
           }
    }b.jsp的js裡
    var w;
                var wTimer;
                
    function wisclosed(){
       if(w.closed){
         window.clearInterval(wTimer)
         var valueAddress1 = document.getElementById("Address1").value;
         var valueAddress2 = document.getElementById("Address2").value;
         with(window.parent.mainFrame.document.forms[0]) { 
              AddressP.value = valueAddress1;
              AddressC.value = valueAddress2;
         }
       }
    }
    上面的AddressP, AddressC  為a.jsp頁面要傳的具體名稱關於window.open的部分
    w =window.open("./SearchZip.do?zip="+zipCode+"&firstZipCode="+firstZipCode+"&secondZipCode="+secondZipCode, "window_name", "width=800,height=350,scrollbars=yes,resizable=yes,statux=yes");
         if (w) {   
         window.w.focus();
         }
       wTimer=window.setInterval('wisclosed()',500);
    body裡的部分
    <form>
    <input type="hidden" id="Address1" >
    <input type="hidden" id="Address2" >
    </form>
      

  14.   

    根據11樓說的
    c.jsp 的js裡
    function search1(n){ 
    if(n.toString().length==1){
       var code = '0' + n;
    }else{
       var code = n;
    }
           if(window.opener) { 
                 fWindowText1 = window.opener.document.getElementById("Address1"); 
                 fWindowText1.value = code; 
                  
                 fWindowText2 = window.opener.document.getElementById("Address2"); 
                 fWindowText2.value = code; 
                  
                  window.close(); 
           }
    }b.jsp的js裡
    var w;
                var wTimer;
                
    function wisclosed(){
       if(w.closed){
         window.clearInterval(wTimer)
         var valueAddress1 = document.getElementById("Address1").value;
         var valueAddress2 = document.getElementById("Address2").value;
         with(window.parent.mainFrame.document.forms[0]) { 
              AddressP.value = valueAddress1;
              AddressC.value = valueAddress2;
         }
       }
    }
    上面的AddressP, AddressC  為a.jsp頁面要傳的具體名稱關於window.open的部分
    w =window.open("./SearchZip.do?zip="+zipCode+"&firstZipCode="+firstZipCode+"&secondZipCode="+secondZipCode, "window_name", "width=800,height=350,scrollbars=yes,resizable=yes,statux=yes");
         if (w) {   
         window.w.focus();
         }
       wTimer=window.setInterval('wisclosed()',500);
    body裡的部分
    <form>
    <input type="hidden" id="Address1" >
    <input type="hidden" id="Address2" >
    </form>
      

  15.   

    根據11樓說的
    c.jsp 的js裡
    function search1(n){ 
    if(n.toString().length==1){
       var code = '0' + n;
    }else{
       var code = n;
    }
           if(window.opener) { 
                 fWindowText1 = window.opener.document.getElementById("Address1"); 
                 fWindowText1.value = code; 
                  
                 fWindowText2 = window.opener.document.getElementById("Address2"); 
                 fWindowText2.value = code; 
                  
                  window.close(); 
           }
    }b.jsp的js裡
    var w;
                var wTimer;
                
    function wisclosed(){
       if(w.closed){
         window.clearInterval(wTimer)
         var valueAddress1 = document.getElementById("Address1").value;
         var valueAddress2 = document.getElementById("Address2").value;
         with(window.parent.mainFrame.document.forms[0]) { 
              AddressP.value = valueAddress1;
              AddressC.value = valueAddress2;
         }
       }
    }
    上面的AddressP, AddressC  為a.jsp頁面要傳的具體名稱關於window.open的部分
    w =window.open("./SearchZip.do?zip="+zipCode+"&firstZipCode="+firstZipCode+"&secondZipCode="+secondZipCode, "window_name", "width=800,height=350,scrollbars=yes,resizable=yes,statux=yes");
         if (w) {   
         window.w.focus();
         }
       wTimer=window.setInterval('wisclosed()',500);
    body裡的部分
    <form>
    <input type="hidden" id="Address1" >
    <input type="hidden" id="Address2" >
    </form>
      

  16.   

    根據11樓說的
    c.jsp 的js裡
    function search1(n){ 
    if(n.toString().length==1){
       var code = '0' + n;
    }else{
       var code = n;
    }
           if(window.opener) { 
                 fWindowText1 = window.opener.document.getElementById("Address1"); 
                 fWindowText1.value = code; 
                  
                 fWindowText2 = window.opener.document.getElementById("Address2"); 
                 fWindowText2.value = code; 
                  
                  window.close(); 
           }
    }b.jsp的js裡
    var w;
                var wTimer;
                
    function wisclosed(){
       if(w.closed){
         window.clearInterval(wTimer)
         var valueAddress1 = document.getElementById("Address1").value;
         var valueAddress2 = document.getElementById("Address2").value;
         with(window.parent.mainFrame.document.forms[0]) { 
              AddressP.value = valueAddress1;
              AddressC.value = valueAddress2;
         }
       }
    }
    上面的AddressP, AddressC  為a.jsp頁面要傳的具體名稱關於window.open的部分
    w =window.open("./SearchZip.do?zip="+zipCode+"&firstZipCode="+firstZipCode+"&secondZipCode="+secondZipCode, "window_name", "width=800,height=350,scrollbars=yes,resizable=yes,statux=yes");
         if (w) {   
          window.w.focus();
          }
        wTimer=window.setInterval('wisclosed()',500);
      

  17.   


    失败了,我还忘了说了 之前那个jsp并没关闭, 点那个jsp上的按纽查询 后 弹出了一个窗口的jsp,从这个窗口的jsp上选地址超链接点击,这个小窗口关闭,选的地址传到了之前那个jsp上了
    你确定你后台actiont有get set,吗