开发者

Is there a better way to redirect and pass parameter

I have this table

<table id="tableDg" border=1>
 <tbody>
 <tr>
  <td ><input type="hidden" id="path" readonly="true" value="{path}">{path}</input></td>
<td><input type="checkbox" class = "chkbCsm" ></input></td>
  <td ><input type="hidden" id="nameText" readonly="true" value="{name}"><a href="#"  class="aDg">{name}</a></input></td> 
     <td ><input type="hidden" id="nameText" readonly="true" value="{host}">{host}</input>     </td> 
  </tr>
 </tbody>
</table>

After reading post from Felix Kling My jQuery

$('#tableDg tbody tr td a.aDg').live('click', function(){
    path=$('input', $(this).parent().prev().prev()).val();
    window.location.href = "/simon/infopage.html";

     var url_action="/getData";
     var client; 
     var dataString;

     if (window.XMLHttpRequest){ 
         client=new XMLHttpRequest();
     } else {                    
         client=new ActiveXObject("Microsoft.XMLHTTP");
     }

     client.onreadystatechange=function(){

         if(client.readyState==4&&client.status==200)
         {
                   //here i will get back path in infopage.html
         }
     };

     dataString="request=getconfigdetails&path="+path;
     client.open("POST",url_action,true)开发者_Python百科;
     client.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

     client.send(dataString);

});

Is this how i should get path from my previous page to infopage.html


You can make something like that:

$('#tableDg tbody tr td a.aDg').live('click', function(){
    $('#tableDg').append('<form action="/simon/infopage.html" id="myform" method="post"> place some inputs here </form>');
    $('#myform').submit();
});


You could have the first page set a cookie, then redirect and read it on the other page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜