How to call a popup from a link inside another popup?

How do you script a link to both click to a popup and redirect the page in the browser?

  • Building a web app in which the user clicks a link to do something that occurs in new window that opens.  I'd like the main page in the browser, where someone clicked, to also change, to a "confirmation page" on the same domain. Simple onclick script, no? I hoping this isn't a sophisticated coding question but that a straightforward script exists. How would I rewrite <a href="link to which I'm sending user">anchor text</a> to not just direct the click to the one new page but another page on a new domain in a popup while refreshing the browser with the page on the same domain?

  • Answer:

    <a href="http://www.example.org" onclick="window.open('http://www.google.com','newwin');">click me</a>

Paul O'Brien at Quora Visit the source

Was this solution helpful to you?

Other answers

You are asking a very vague question w/o any additional information e.g. whether the content that you load in the new window would be served from the same domain? Are you using any navigation framework? Would the "confirmation screen" reside as a separate REST resource (If not, then we can use show/hide to display that)? I will try to answer it based on assumptions. Have a javascript function execute bind to on click event on the DOM element of your choice. The function should do the following:- 1. Use https://developer.mozilla.org/en-US/docs/Web/API/Window.open to open a new tab passing in the data required to render that page. 2. Use https://developer.mozilla.org/en-US/docs/Web/API/Window.location to navigate your current page to "confirmation screen".

Divij Vaidya

The href attribute of the link should point to the page you want to navigate in the current window. And write window.open in a js that gets triggered onclick of this link. Window.open should point to the page you are looking to open in popup

Anurag Ashok

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.