navigator.standalone倒退?

时间:2013-11-11 00:14:14

标签: javascript ios iphone-standalone-web-app ios-standalone-mode

我使用以下代码:

if (navigator.platform == 'iPad' || navigator.platform == 'iPad Simulator' || navigator.platform == 'iPhone' || navigator.platform == 'iPhone Simulator' && window.navigator.standalone === false) {
window.alert("We've detected you're on iOS. Did you know that you can put us on your home screen? Tap the share icon, then tap 'Add to homescreen'.");

}

要提醒他们有一个独立选项可用,但它不起作用...奇怪的是我只在应用程序处于独立模式时才能获得它。我究竟做错了什么?

编辑:我实际上发现我在函数之外做代码。我认为这样会很好,但不是。

0 个答案:

没有答案