PDA

View Full Version : pop up to open in main window not pop up


Dean
09-18-2002, 03:41 PM
hi there

has any one out their got a script that when a pop up has a link in it and you click the link the pop up closes and the page underneath changes to the link that was clicked in the pop up.

this script is to go onto the page in the popup not on the page doing the poping

:confused: :confused:

beetle
09-18-2002, 03:45 PM
Ya, see this thread (http://www.codingforums.com/showthread.php?s=&threadid=6279&highlight=exitPop)

Dean
09-18-2002, 04:05 PM
Hi beetle

I am using htm pages to pop up a page with register for a news letter i want to stick two links on the thankyou for registering page that will close the pop and then change the mian browser window tothe link click.

Will what you have put work with a normal html href bit of code???

any suggestions welcome here is the code i am using at present:

<a href="../email/default.asp" class="links" target="_blank" >click here</a>

So that it opens a new window rather than onluy getting the top corner.

So if their is a bit of code i can add to get the pop up to close and the link to open in the window that generated the original pop up i would be grateful

beetle
09-18-2002, 04:10 PM
Uh, what I posted before IS the code, but it's not just HTML, it's javascript.

In popup <script>
function exitPop(nUrl) {
top.opener.location.href = nUrl;
top.close();
}
</script>

<a href="link.htm" onClick="return false; exitPop(this.href);">Click here</a>

Dean
09-18-2002, 04:24 PM
hi bettle

Many thanks.

I have been a dunamic press cemtre all day and my head is going a bit code blind as i have being doing vbscript for asp.

Thanks for the help.:thumbsup: :thumbsup: :thumbsup: