Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Page -> Popup -> New Page (close popup, leave old page open)

Thread Tools

Page -> Popup -> New Page (close popup, leave old page open)
Posts: n/a
I KNOW this can't be as hard as I am making it.

I have a travel client with two related websites. On the homepage of
the new site (Call it "Site A") I am building for them, there is a link
to a popup window that includes the European regions both companies
offer (Links to both site A and site B).

If they click on a region that is a "Site A" region, the popup closes,
and the homepage is changed to the region page for Site A, for the
selected region.

If they click on a region that is a "Site B" region, a new window opens
with the Site B region page, but the popup doesn't close, I am assuming
because the focus is now on the Site B page. That means if they go back
to Site A and try to get that popup again, there's a good chance it
will be hidden behind the Site A homepage. (Besides, it's just messy
leaving windows open like that.)

And example Site B link within the Site A popup would be:

<a target="newwindow" href=""
onclick=""","_blank");window.close();">Salzbu rg</a>

If this link is clicked on, the Site A homepage remains open, the Site
B Region page opens in a new window, but the popup does not close.

I've tried using window.opener.location as well, but get similar
results. What stupid thing am I doing THIS time?



Reply With Quote
Posts: n/a
OK, I *did* figure out that if I put this in the Site B region page
(regionlist is the name of the popup window) it will close. But then it
slows down the region page loading on Site B, and kind of "blinks". Any
better solutions out there?'','regionlist','');



Reply With Quote
Posts: n/a
OK, SOLVED, thank God, for the person who is searching for this. Note
that I think this will only work if you have access to the page that
you are linking TO as well as the one that you are linking from.

The onclick was the same, other than I gave it a particular name -
don't know if this made a difference or not, but I included it in case
it did:

THen in the reg.asp file for siteb, I included the following Javascript
(remember, the name of my popup is regionlist):

if (window.opener=="regionlist" && !regionlist.closed)

Haven't tested this cross-browse yet, and I'm hoping to God it will
work - lol (Big site, minor page

Hope this helps someone else!


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Must leave the page and return to get the page to update Cal Who ASP .Net 6 02-01-2010 02:08 PM
Java Popup on Leave Problem Steve Horrillo HTML 17 07-12-2005 09:27 PM
Old computer hates to leave Maybe Computer Support 24 06-15-2005 05:53 PM
New Popup Window from an existing Popup Window Raffi Javascript 4 08-12-2004 01:21 PM
Main > Popup > Popup > Close popup AND new URL in main? Jens Peter Hansen Javascript 7 06-19-2004 08:56 PM