admin管理员组文章数量:1291616
Is there a way to check to see if an iPhone is online from a web app. That is, in mobile Safari, can I check the online status of the device to see if I should try an AJAX call or not.
In Firefox/regular WebKit, this would be:
if(navigator.onLine)
{
onlineCode()
}
Is there a way to check to see if an iPhone is online from a web app. That is, in mobile Safari, can I check the online status of the device to see if I should try an AJAX call or not.
In Firefox/regular WebKit, this would be:
if(navigator.onLine)
{
onlineCode()
}
Share
Improve this question
edited Jul 8, 2014 at 14:07
FelipeAls
22.2k9 gold badges56 silver badges74 bronze badges
asked Sep 15, 2008 at 20:15
TedTed
512 silver badges4 bronze badges
3 Answers
Reset to default 4img src="http://aonlinesite./a-really-little-image.png" onload="Intenet!" onerror="NoInternet!"
A quick test on the iPhone shows that it is available from iPhone OS 2.2.
That same code should work in the WebKit nightly build as of May 16th 2008. I guess that means you need to hope the 2.1 update included a new build of safari.
https://bugs.webkit/show_bug.cgi?id=19105
本文标签: javascriptChecking online status from an iPhone web appStack Overflow
版权声明:本文标题:javascript - Checking online status from an iPhone web app - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741536592a2384060.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论