
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/AndroID/i)) || (navigator.userAgent.match(/iPod/i))) { window.location = "http://sitename.com/m/"; } 适用于iPhone和iPod,但AndroID没有成功.我在Eclipse中使用AndroID模拟器.我没有AndroID小工具来实际测试它.
难道我做错了什么?谁有同样的问题?
解决方法 您应该使用location.replace而不是window.location例:
if( (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/AndroID/i)) || (navigator.userAgent.match(/iPod/i)) ) { location.replace("http://sitename.com/m/");} 我使用这个代码,它适用于iPhone / itouch和AndroID手机/设备.
总结以上是内存溢出为你收集整理的Android模拟器浏览器检测全部内容,希望文章能够帮你解决Android模拟器浏览器检测所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)