View Full Version : Closing a popup
hubbni
05-17-2003, 12:19 AM
I am working on a page and I have made a pop up. What I want to do it be able to click on the link inside the pop up, and have the popup close, and go to the link in the main window. Now someone showed me the code for this before, but it seemed to not work. I am new at this, can you show me where to put the link in the line of code? Thanks.
HairyTeeth
05-17-2003, 08:16 AM
Try this in the popup:
function myFunc(where){
opener.document.location = where
self.close()
}
To call the script (within the popup):
<a href="javascript: myFunc('some_link.htm')">Some Link</a>
That should work.
hubbni
05-19-2003, 07:59 PM
Will it still work if the link is inside of an include tag?
liorean
05-19-2003, 09:55 PM
I suggest merging this thread with <http://codingforums.com/showthread.php?s=&threadid=20019>. an mod here to do that?
HairyTeeth
05-19-2003, 10:36 PM
An SSI? It should do. Try it.
liorean
05-20-2003, 03:42 PM
The SSI is performed serverside, before the script is even passed to the browser. As such, the browser doesn't even know an insertion has been performed, and it should make no difference for the running of the script in the browser.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.