| OS X - Operating System General OS operation information and support |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Jul 19, 2010
Posts: 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 |
| QUOTE Thanks | |
![]() Member Since: Oct 19, 2008
Location: Ottawa
Posts: 15,337
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2012 13" MBP (2.5 i5, 8GB)
|
You can only close a window with JS if you opened it with JS. How are you opening the window?
See the following: http://www.velocityreviews.com/forum...mac-close.html http://forums.macosxhints.com/showthread.php?t=56352 EDIT: Apparently, I am wrong. Just tried it here and it works with some browsers (Opera and Safari) but not others (Chromium). Will get back to you. Important Links: Community Guidelines : Use the reputation system if you've been helped. M-F Blog :: Write for the blog :: M-F IRC Channel - Chats every Sunday at 8PM EST. |
| QUOTE Thanks | |
![]() Member Since: Sep 19, 2008
Location: Nottingham, UK
Posts: 302
![]() Mac Specs: 20" iM ac,13.3" Aluminium Unibody Macbook, iPhone 4
|
Thanks, Eddie Software Engineering Student, NTU |
||||
| QUOTE Thanks | |||||
![]() Member Since: Oct 19, 2008
Location: Ottawa
Posts: 15,337
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2012 13" MBP (2.5 i5, 8GB)
|
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?
Important Links: Community Guidelines : Use the reputation system if you've been helped. M-F Blog :: Write for the blog :: M-F IRC Channel - Chats every Sunday at 8PM EST. |
| QUOTE Thanks | |
![]() Member Since: Sep 19, 2008
Location: Nottingham, UK
Posts: 302
![]() Mac Specs: 20" iM ac,13.3" Aluminium Unibody Macbook, iPhone 4
|
Chrome, dosnt work Firefox, dosnt work Safari 4, dosnt work Safari 5, DOES work You CAN close a FireFox window/tab even if your script didn't open it Try this. Thanks, Eddie Software Engineering Student, NTU |
| QUOTE Thanks | |
![]() Member Since: Oct 19, 2008
Location: Ottawa
Posts: 15,337
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2012 13" MBP (2.5 i5, 8GB)
|
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.
Important Links: Community Guidelines : Use the reputation system if you've been helped. M-F Blog :: Write for the blog :: M-F IRC Channel - Chats every Sunday at 8PM EST. |
| QUOTE Thanks | |
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Safari Download Window Autoclose? | Marino | OS X - Apps and Games | 1 | 06-11-2010 07:18 PM |
| Sometimes it won't let me close a window till i drag it then try again? | Tyler Gostynski | OS X - Operating System | 0 | 02-18-2010 06:21 PM |
| Maximizing the Safari Window | Jaygray | OS X - Apps and Games | 0 | 10-26-2008 01:10 PM |
| Safari: new tab instead of new window? | smurfy | OS X - Apps and Games | 5 | 07-25-2007 01:20 PM |
| safari Window won't close | jeje13 | OS X - Operating System | 3 | 01-01-2007 11:54 AM |
All times are GMT -4. The time now is 09:18 PM.
Powered by vBulletin