开发者

Closing an opened window on mobile safari with javascript?

开发者 https://www.devze.com 2022-12-08 13:43 出处:网络
In app mode, if I open a new window using javascript, the newly-opened window cannot close itself (on an on-开发者_StackOverflow中文版click event) using the standard window.close() or self.close().Doe

In app mode, if I open a new window using javascript, the newly-opened window cannot close itself (on an on-开发者_StackOverflow中文版click event) using the standard window.close() or self.close(). Does anyone know if there's an alternate method?

What I find most beguiling about this is that it goes against Apple's very own design guidelines: essentially a site has the ability to open a new window but the user cannot get out of it without closing the webapp using the Home button.

Any ideas? Thanks!


JavaScript:window.self.close() is how to do that.


you can try this js code snippet. var win = window.open('','_self'); win.close();

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号