简体   繁体   English

检测没有移动的浏览器?

[英]Detect browsers that AREN'T mobile?

I'm using the javascript from http://detectmobilebrowsers.com/ to see check if a browser is mobile and then use a different version of my website. 我正在使用http://detectmobilebrowsers.com/中的javascript来查看浏览器是否可移动,然后使用我网站的其他版本。

However I'd also ideally like the site to revert to desktop if a browser isn't one of the mobile ones. 但是,如果浏览器不是移动浏览器之一,我也希望该站点恢复到桌面。

I don't wanna post the whole thing because it's quite long but the function goes like this: 我不想发布整个内容,因为它很长,但是功能如下:

(function(a,b){if(/...'http://detectmobilebrowser.com/mobile');

So basically, I want 'if' to instead have a role of 'if not'. 因此,基本上,我希望“如果”充当“如果不是”角色。 How can I accomplish this? 我该怎么做?

在JavaScript聊天中大喊@JennaSloan-答案是使用以下方法:

if(!( or if(false==(

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM