homepage Welcome to WebmasterWorld Guest from 54.166.53.169
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Javascript and Controlling Different Windows
Opening multiple windows with javascript and controlling them
craigtubby

10+ Year Member



 
Msg#: 210 posted 2:04 pm on Oct 18, 2002 (gmt 0)

Not sure if Im in the right place to put this ...

I'm using javascript to open 2 windows up, lets say with the following code

"navigation=window.open ('navigation.asp', 'navigation')
content=window.open('content.asp','content')"

Now I want the Navigation window to "control" the content window - the opening window will have nothing to do with this and sit in the background, so the question is "how do I reference the windows?"

For example there will be close button on the navigation window that will close itself and the content window. The closing self is easy, but how do I close the content window?

From what I am reading I should be able to use "content.close" or "window[content].close" but both are returning errors (generally of the type "object is empty or does not exists" or "conetent is undefined) although they work in the parent window. (ive also tried top.conetnt.close() and parent.window[content].close() )

Is it actually possible to do what I want with javascript, or is it a big no no?

 

korkus2000

WebmasterWorld Senior Member korkus2000 us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 210 posted 12:51 pm on Nov 19, 2002 (gmt 0)

I believe it will work if you reference through the opener. Try opener.content.close().

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