How To Close Window in safari for Mac Os

Joined
Jul 19, 2010
Messages
1
Reaction score
0
Points
1
Hi............
The problem is using Safari in Mac Oprating System.I am unable to Close Window using java script window.close() or self.close().I'm using the following code line, which is working fine with all browser of Window OS.

<script type="text/javascript">
<!--
self.focus();
setTimeout("self.close();",1);
//-->
</script>

and

<a href="javascript:window.close();">Close this window</a></span>

Any help most appreciated.

Mohan Reddy
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Joined
Sep 19, 2008
Messages
302
Reaction score
4
Points
18
Location
Nottingham, UK
Your Mac's Specs
20" iM ac,13.3" Aluminium Unibody Macbook, iPhone 4
Vansmith, as far as I am aware you are correct. That is what I have always been told, but some browsers ignore this and it does work.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
I'm not at my Mac right now so you'll have to test this yourself with other browsers. I only say that you'll have to test this because it works fine for me in Safari here (Windows) while it doesn't for you. Does this work in other browsers?
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Works in Opera 10.70 (dev build) on Windows. Mohan, do you have any source we can take a look at? It would make solving this much easier.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top