admin管理员组文章数量:1300203
I got this for IE browsers,
var IE = /*@cc_on!@*/false;
if (IE) {
// IE.
} else {
// Others.
}
but how would i do the same for iphone/ipad/mobiledevices? (do not want to redirect to another page on any mobile devices)
I got this for IE browsers,
var IE = /*@cc_on!@*/false;
if (IE) {
// IE.
} else {
// Others.
}
but how would i do the same for iphone/ipad/mobiledevices? (do not want to redirect to another page on any mobile devices)
Share Improve this question edited May 2, 2010 at 4:09 Daniel Vassallo 345k72 gold badges512 silver badges446 bronze badges asked May 2, 2010 at 4:01 user295292user295292 2003 silver badges12 bronze badges2 Answers
Reset to default 8You may want to check the user agent string as follows:
var userAgent = navigator.userAgent;
if (userAgent.match(/iPad/i) || userAgent.match(/iPhone/i)) {
// iPad or iPhone
}
else {
// Anything else
}
That should be a bit of a problem because every app makes its own Header. My apache server gets this as Browser: [APPNAME]/1.0_CFNetwork/459_Darwin/10.3.0
You could search for Darwin, but I don't know if this is waterproof.
A JS-Snippet should look like that:
if (navigator.userAgent.indexOf("Firefox") != -1)
{
document.write('You're using Mozilla Firefox');
}
本文标签: how do i disable a certain javascript on iphoneipad or other mobile devicesStack Overflow
版权声明:本文标题:how do i disable a certain javascript on iphoneipad or other mobile devices? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741657195a2390825.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论