homepage Welcome to WebmasterWorld Guest from 54.204.59.230
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

    
Close pop-up AND load new page in the original window
looking for javascript code to run in pop-up window
kevinj




msg:1476635
 3:12 pm on Jan 22, 2003 (gmt 0)

My client has a web site that I maintain which is for his annual music education convention. They want as many groups to apply to perform this year so they've decided they want to have a pop up window appear when you enter their home page which asks groups to apply. Does anyone know where I can find a pop-up script which loads the pop up window and when someone clicks on it, the window closes and a new page loads on the site?

Thanks,

Kevin

 

hakre




msg:1476636
 3:26 pm on Jan 22, 2003 (gmt 0)

hi kevinj,

to open a window in javascript, you can use window.open(). to close the window you have to call self.close() in the html of the opened window.

do you have a javascript reference? for an example try a search on google for popup js script. there should be a lot of stuff.

tedster




msg:1476637
 6:15 pm on Jan 22, 2003 (gmt 0)

...when someone clicks on it, the window closes and a new page loads on the site

From within the new pop-up window, javascript can address the original (parent) window as window.opener. For example, this code in the anchor tag --

<a href="#" onClick="window.opener.location='new_page.html';window.close();">link text</a>

would load close the pop-up window and load new_page.html in the original window.

hakre




msg:1476638
 8:51 pm on Jan 22, 2003 (gmt 0)

my fault :(

kevinj




msg:1476639
 10:30 pm on Jan 22, 2003 (gmt 0)

Thanks Tedster and Hakre. I got it to work perfectly!

Kevin

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