Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open page from a popup in the parent/main and close popup

Status
Not open for further replies.
May 12, 2002
51
US
The majority of the links on my main page open in a popup window. If a user click on a bad link, my custom 404 error page pops up. I have a link on the 404 page that will return the user to my main page, but I want the main page to open in the OTHER window (not the popup) and I want the pop up to close automatically.

Anyone know of a script like this?

Thanks! Thanks!
-JusTin
 
If i understand you correctly you will want to use this script on the 404 error page to take them back to the main page and close the popup window ::

<script language=&quot;javascript&quot;>
<!--
function goBackToMain(){
window.opener.href = &quot;yourmainpage.html&quot;;
self.close()
}
//-->
</script>

and you can call it from your link like so ::
<a href=&quot;#&quot; onclick=&quot;goBackToMain()&quot;>Back To Main Page</a>

I have used script like this before and it worked fine.
hope this helps you out. Megalene
If you crap it will stink!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top