Piscean
Piscean

Reputation: 3079

how to redirect a page which creates a popup, from that created popup using jQuery?

I am new to jQuery. I have a button on main page of my web application which creates a login pop. If user enters correct password then popup should be disappeared and the page which create that popup should go to welcome page of that user. I know how to disappear the popup if user enters correct password. How can I tell the explorer window which created that popup to go to the welcome page? Thanks in advance.

Upvotes: 1

Views: 1439

Answers (2)

James Johnson
James Johnson

Reputation: 46047

You don't need jQuery for this. Some simple JavaScript should do the trick.

//reload the parent window
//window.opener.location.reload();

//to change the parent window location
window.opener.location.href = "welcome.htm";    

//close the current window
self.close();

Upvotes: 2

Igor
Igor

Reputation: 33963

I believe with Javascript you can redirect the parent window with:

window.opener.location.href = <your url>;

And then simply close your popup:

window.close();

Upvotes: 3

Related Questions