
-----------------------------------
[Gandalf]
Sat Jul 09, 2005 12:07 am

&lt;Javascript&gt; Close Window/Open Site in New Window
-----------------------------------
Not sure if JavaScript belongs here or in the Java section, but I think its here :).

Does anyone know a way to close the current browser window, and open a new window with a new site?  The problem is that I have a redirect url, but it adds all these annoying adds to my site, so I want the site to automatically open a new window with my real (long) site address.

Thanks for any help.

-----------------------------------
wtd
Sat Jul 09, 2005 2:06 am


-----------------------------------
if (Java == Javascript)
   hell.frozen = true;

;)

-----------------------------------
[Gandalf]
Sat Jul 09, 2005 8:10 pm


-----------------------------------
:) Can this be done with anything else?  I asked for JavaScript though since it's probably the simplest way...

If nobody can help then I will just change my redirect url host, still...

-----------------------------------
wtd
Sat Jul 09, 2005 9:24 pm


-----------------------------------
[url=http://www.google.ca/search?q=javascript+window+open+close&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox&rls=org.mozilla:en-US]Use Google.

-----------------------------------
[Gandalf]
Sat Jul 09, 2005 10:49 pm


-----------------------------------
Thanks!  I em... forgot about Google.  I thought it would be something more complicated :).

Which brings me to my next question:
How do I close the current window and load up a new one, in that order.  Because I want the first window to go away, and a new one load up, but that can't happen if the first window is gone :?.

-----------------------------------
rdrake
Sun Jul 10, 2005 10:57 am


-----------------------------------
You can reuse the window and avoid using javascript by using the refresh meta tag.  More details on that can be found [url=http://www.indiana.edu/~wmhome/tool_guide_info/refresh_metatag.shtml]here.  The only way that I know of that you could use to launch a page after closing the other main one is by using a very small popup which is launched from the first page, waits a bit, then launches the second page.

Javascript wasn't even based on Java, Netscape just named it that because of the polularity Java had at the time.  So I remember reading anyways.

-----------------------------------
[Gandalf]
Sun Jul 10, 2005 2:05 pm


-----------------------------------
Alright thanks, I'll look into it.  The problem was that the add would appear on any page that you went to from my site.  Even if it was non-related.  For now the solution I found was auto scrolling down the site whenever its loaded :).
