View Full Version : Closing A Window After Opening One.
REEFˇ
August 17th, 2003, 09:37 PM
I have a question about a javascript code that should be simple.
1. (HTML PAGE), I have on a page where it says the requirements needed to view the flash site. There is a text button that says 'Launch Site', now whats the code that I have to put in it, then when it does launch the site, it closes the requirements page?
Digitalosophy
August 18th, 2003, 11:49 AM
if you new page is a popup, you should never close the index page
java and javascript are 2 very different languages
REEFˇ
August 18th, 2003, 12:19 PM
Yea you're right. I mean javascript, whatever. Yes, my new page is a popup. And exactly why should I not close the index? Maybe cause if the people close the new window by accident?? Is that what you're saying?
Digitalosophy
August 18th, 2003, 01:33 PM
yup, what if they close the window and can't get back to your site
Voetsjoeba
August 18th, 2003, 02:27 PM
Don't you want to keep it open but replace it with another, so that when the user closes the pop-up the chance is given to open it again (from the other page). But anyways.
In the <head> section, place:
<SCRIPT language="JavaScript">
function openclose()
{
your_window = window.open("http://www.whatever.com/pagetoopen.html","yourwindow","status=0,width=500,height=200");
self.opener = null;
self.close();
}
</SCRIPT>
And use this for the link:
<a href="javascript:openclose()">Launch</a>
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.