Welcome to WebmasterWorld Guest from 54.196.175.173

Forum Moderators: open

Message Too Old, No Replies

Close pop-up AND load new page in the original window

looking for javascript code to run in pop-up window

     

kevinj

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

10+ Year Member



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

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

WebmasterWorld Senior Member 10+ Year Member



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

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

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



...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

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

WebmasterWorld Senior Member 10+ Year Member



my fault :(

kevinj

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

10+ Year Member



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

Kevin

 

Featured Threads

Hot Threads This Week

Hot Threads This Month