Forum Moderators: open

Message Too Old, No Replies

window.close in safari

         

frontsidenm

9:00 pm on Nov 13, 2005 (gmt 0)



hi everyone.

This is my first post and hopefully i can get some help.

I have been making an HTML cd rom. There is a bit of script in the head as below:

<SCRIPT LANGUAGE="JavaScript">
function openWin(pageName) {
var newWin = window.open(pageName,"webFile","height=520,width=730,toolbars=no,scrollbars=yes,resizable=yes");
}
</SCRIPT>

and on the close button is the link:
javascript:window.close()

This works fine on all browsers and platform, except firefox.

my problem is when you open the start.html file in safari on the mac, the close button works fine, but if you navigate to another page (which has the same head script, and link on the button) the close doesn't work. has anyone else had issues with this, and if so, did you manage to get round it?

also, is someone has an idea of why it doesn't work on firefox, this would also be a great help!

thanks alot in advance!

Mark

BlobFisk

12:30 pm on Nov 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi frontsidenm and welcome to WebmasterWorld!

Have you tried self.close()?

However, one thing to make sure of is that you are closing a window that was opened by a JavaScript window.open. Also, use the following:


<script type="text/javascript">

This is the compliance markup, language is deprecated.

HTH