homepage Welcome to WebmasterWorld Guest from 54.226.80.55
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
close a window and target the window behind in one link?
scopa




msg:1472684
 10:41 pm on Jun 18, 2003 (gmt 0)

<sorry, no links to personal examples>

when you click a link, a new window pops up, and when you click "front cover" the window closes. well, I would like the window to close, AND target the window behind to go to the main page, or open a new window with the main page on it. (in case someone had left the main page, or closed the window)

any ideas?

thanks

[edited by: tedster at 1:09 am (utc) on June 19, 2003]

 

HocusPocus




msg:1472685
 11:10 pm on Jun 18, 2003 (gmt 0)

No URLs or specifics are allowed. You'll need to owner edit or the Mods will. Why have you got so many windows oopening. Sites that open windows on every link drive me nuts.

In the new window, you'll need to add an onclick event handler to the link, something like

onclick="
if(top.window.opener)
{
top.window.opener.location='anypage.html';
}
else
{
open('anypage','',[your featurelist here]);
}
top.window.close();
"

that should do it.

scopa




msg:1472686
 2:31 am on Jun 19, 2003 (gmt 0)

there is a cover page, and when you click the cover page, the main page opens in a small, contained window with no buttons, location or resize options etc... it doesn't open a lot of windows. only one.

anyway, if the user wants to go back to the main page for any reason, then the pop-up would need to close, and the main browser window behind should go to the index page (if it isn't there already.

as for opening a new window... that is only if they accidentally or purposely closed the main browser window. Clicking "cover page" would have to open a new window and go to the index.

I'll give the code a try. Thanks!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved