-1
我有这个表有没有更好的办法来重定向和传递参数
<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>
从费利克斯·克林阅读后 我的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);
client.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
client.send(dataString);
});
经过是这样我应该如何从中获取path
我的上一页到infopage.html
而你不希望有'在地址栏中显示path'? – 2011-06-06 07:56:52
@Felix Kling:是的,页面重定向后,路径在我的地址栏中仍然可见,我不想要 – abi1964 2011-06-06 08:03:55
你需要哪个路径值?服务器端还是客户端?你为什么不做POST请求? – 2011-06-06 08:07:22