从iPhone Web应用程序检查在线状态 [英] Checking online status from an iPhone web app
本文介绍了从iPhone Web应用程序检查在线状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法通过网络应用查看iPhone是否在线。也就是说,在移动版Safari中,我可以检查设备的在线状态,看看我是否应该尝试AJAX调用。
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.
在Firefox /常规WebKit中,这个将是:
In Firefox/regular WebKit, this would be:
if(navigator.onLine)
{
onlineCode()
}
推荐答案
img src =http://aonlinesite.com /a-really-little-image.pngonload =Intenet!的onerror = NoInternet!
img src="http://aonlinesite.com/a-really-little-image.png" onload="Intenet!" onerror="NoInternet!"
这篇关于从iPhone Web应用程序检查在线状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文