我的理解是,你需要打开另一个选项卡或弹出一些动态参数。 我对此有两种解决方案:
1-附加一些额外的JS到锚点用户将点击使用onMouseOver()事件并提供您的计算的URL的href。目标必须设置为“_blank”。
例子:
<a href="whateverPage.php" target="_blank" onMouseOver="this.href='myPage.php?myParam=' + myParamValue;">Goto new page</a>
注意,在这个例子中 'myParamValue' 必须是全球性的。
2-你想打开一个新的标签或在ajax请求后弹出吗?在我的情况下,我想在服务器上生成一个新的PHP页面报告,并希望立即打开它。以前的解决方案没有帮助。
这里是我的解决办法骗过弹出窗口拦截器:
//this generates the new report page
report = new ajaxReq("gentabrep.php", ajaxCallBackFunction);
//open the pop-up on user action/event which is normally allowed
w = window.open("", "");
//run ajax request, note I also pass the "w" pop-up reference to the request
report.request("connId=" + connId + "&file=" + file, "POST", [w, file]);
function ajaxCallBackFunction(returnedStr, status, params){
//I feed the pop-up with the necessary javascript to redirect the page immediately
params[0].document.writeln("<scr"+"ipt type='text/javaScript'>window.location='reports/" + params[1] + ".php';</scr"+"ipt>");
}
我尝试了所有上述三个,但随后出现的页面是从中调用函数与它相连的变量在同一页。 从 HTTP://localhost/thirdPage.php P = TABLENAME 到 HTTP://localhost/thirdPage.php checkbux = R&checkbux = V&checkbux = Y – chella 2011-05-23 23:45:00