Closing an opened window on mobile safari with javascript?
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();
精彩评论