The example in this article describes the js solution to implement window.open without being intercepted. Share it with everyone for your reference. The specific analysis is as follows:
1. Question:
Today, while processing the page ajax request, I wanted to open a new page after the request, so I thought of using js window.open to achieve it, but it was eventually intercepted by the browser.
2. Analysis:
Search Google for any solutions. Some say it can be achieved by creating a new a tag and simulating clicks. However, the test found that it cannot be achieved and is still blocked by the browser.
Finally, I found a compromise method that can open a new page, but without the effect of direct traffic to the new page like the a tag.
3. Implementation code:
I hope this article will be helpful to everyone’s web programming based on JavaScript.