[英]How to redirect and open new tab in one click
In page one : Form and submit to page two 在第一页:填写表格并提交至第二页
page two : Insert data, open new tab and redirect to page one 第二页:插入数据,打开新标签并重定向到第一页
I'm using 我正在使用
window.open("pdf_order.php?p=<?=$paper;?>","_blank");
window.location = "page1.php";
but, It's doesn't work because block popup on browser. 但是,它不起作用,因为在浏览器中阻止了弹出窗口。
According to your question, you want to issue a window.open
call when you arrive on "page two." 根据您的问题,您想在到达“第二页”时发出window.open
调用。
You can't, because that's what scuzzy websites used to do, and this is the whole point of popup blockers. 您不能,因为那是混乱的网站过去要做的事情,而这就是弹出窗口阻止程序的全部目的。 Instead, you'll need to adjust the clickflow so you're not trying to do that. 相反,您需要调整点击流,以免您尝试这样做。
This is a question of the type: Doing X is not allowed. 这是类型的问题: 不允许执行X。 How to do X? 怎么做X?
If a popup blocker allowed you to do a popup, it would be a very bad blocker, and people would not use it. 如果弹出窗口阻止程序允许您执行弹出窗口,那将是一个非常糟糕的阻止程序,并且人们不会使用它。
Please understand that a popup blocker is always a step ahead of you: it uses interface to a concrete Web browser which in turn take a total control of all rendering and scripting on the client side. 请理解,弹出窗口阻止程序始终是您前面的一步:它使用特定Web浏览器的界面,而该Web浏览器又可以完全控制客户端上的所有呈现和脚本。 And your application is supposed to work with all kinds of HTTP client software and be somewhat abstracted from it. 您的应用程序应该可以与各种HTTP客户端软件一起使用,并且可以从中抽象一些。 From this point, it's easy to understand that it's much easier for a blocker to block your code then break this blocking. 从这一点出发,很容易理解,阻塞者阻塞代码然后打破阻塞变得容易得多。
found this answer on http://www.codeproject.com/Questions/474314/PopUpplusBlockerplusisplusdisplayingpluswhenplusop 在http://www.codeproject.com/Questions/474314/PopUpplusBlockerplusisplusdisplayingpluswhenplusop上找到了此答案
try AJAX 试试AJAX
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.