window.close()不适用于iOS 8 GM种子 [英] window.close() doesn't work on iOS 8 GM seed
问题描述
我正在尝试通过 Javascript
使用 window.open()
打开新标签页,然后使用 window.close()
关闭,但似乎 window.close()
在safari中不起作用(iOS 8 GM种子) )。以下是代码:
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;>打开B< / button>
B。 html:
< button onclick =window.close();>关闭< / button>
我尝试了几种方式: setTimeout , window.open()
然后关闭,但没有帮助。
I tried several ways like: setTimeout, window.open()
then close, but doesn't help.
这种情况有解决方法吗?
Is there any workaround for this situation?
推荐答案
没有解决方法。
我在网页上添加了一条消息。
'如果没有自动关闭,请关闭此窗口。'
I added a message in our web pages. 'Please close this window if it does not close automatically.'
有关于此问题的论坛。
https://devforums.apple.com/message/1044445
There is a forum about this issue. https://devforums.apple.com/message/1044445
这篇关于window.close()不适用于iOS 8 GM种子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!