PDA

View Full Version : Anyone a Java or Web Dev Guru?


Revhed
26th February 2008, 07:57 PM
Had some stuff come up today at work. I'm looking into a way of closing a web page via html or Java script (or maybe applett) that closes the tab or browser window it opened in.

(IE, Page opens, displays what it needs to, then page closes gracefully.)

The catch is that this need to occur in a Safari browser (OSX). Now I've done a bit of googling and I've found articles that say it can't be done, and others that say it's possible........so anyone able to offer any thing more concrete?

Revhed
27th February 2008, 02:10 PM
hmm, after a bit more googling and some more testing it appears that this string will work:

<a href="javascript:top.close()">close your browser window</a>.

Woks in IE if you click throught the Activex warnings, works fine in safari 3 (and most likely 2) but doesn't work in Firefox.

We've got the Devs adding in a conditional statement to apply different code if it finds firefox :)