Jump to content

Href In Pop-up Window


amitamberker

Recommended Posts

hi,upon clicking "Close POP-UP Window" saying, how can i have the existing or opened browser [ www.domain.com/123.html ] directed to a specific page [ www.domain.com/456.html ]?

<html><head><title>Thank You</title><style type="text/css">.style1 { font-family: Verdana; font-size: 10pt; color: #FFFFFF; font-weight: bold;}.style2 { font-family: Verdana; font-size: 10px; color: #FFFFFF; font-weight: bold; text-decoration: none;}.style2:hover { font-family: Verdana; font-size: 10px; color: #FFFFFF; font-weight: bold; text-decoration: underline;}</style><script language="javascript">function CloseWindow(){window.open('','_self','');window.close();}</script></head><body bgcolor="#FF3300"><span class="style1">We have received your E-mail and thank you for contacting xyz.com. Will revert to you ASAP.<br/><br/>- <a class="style2" onclick="CloseWindow();" value="Close" href="#">Close POP-UP Window</a> -<br/></span></body></html>
Link to comment
Share on other sites

If that window was opened from another window, and you want to change the URL of the parent window when you close the child window, inside the child window you can set window.opener.location.href to the URL you want to redirect to.

Link to comment
Share on other sites

If that window was opened from another window, and you want to change the URL of the parent window when you close the child window, inside the child window you can set window.opener.location.href to the URL you want to redirect to.
hey, you are puzzling me... let me explain again.1. there is a page [of-course opened in web browser] named as 123.html2. upon clicking "click here" in 123.html page, a pop-up window will open [the same html code which i have shown above]3. upon clicking "Close POP-UP Window" saying, the pop-up window should close and the opened 123.html should direct to 456.html so WHERE and HOW do i set the window.opener.location.href?please help.
Link to comment
Share on other sites

You set window.opener.location.href in the popup window before you close it, in your CloseWindow function. window.opener refers to the parent window that opened the popup.
Like this?
<script language="javascript">function CloseWindow(){window.open('','_self','');window.close();window.opener.location.href}</script>
and where should i place 456.html ?
Link to comment
Share on other sites

justsomeguy and jesh,Thanks a lot guys. It's working great...TOPIC CLOSED!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...