Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
79
rated 0 times [  83] [ 4]  / answers: 1 / hits: 18192  / 10 Years ago, fri, september 12, 2014, 12:00:00

I am trying to open new tab via Javascript using window.open(), then using window.close() to close, but it seems window.close() doesn't work in safari( iOS 8 GM seed). Here is the code:



A.html:



<button onclick=window.open('./B.html'); return false;>Open B</button>



B.html:



<button onclick=window.close();>Close</button>



I tried several ways like: setTimeout, window.open() then close, but doesn't help.



Is there any workaround for this situation?


More From » ios

 Answers
24

There isn't a workaround.



I added a message in our web pages.
'Please close this window if it does not close automatically.'



There is a forum about this issue.
https://devforums.apple.com/message/1044445


[#69479] Wednesday, September 10, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
angelr

Total Points: 399
Total Questions: 96
Total Answers: 101

Location: Finland
Member since Sun, May 21, 2023
1 Year ago
;