开发者

navigator.userAgent for non Smart devices

It is simple to detect the smart device from navigator.userAgent

like navigator.userAgent.match(/iPhone/i) , navigator.us开发者_StackOverflow中文版erAgent.match(/Android/i), etc.

How do i get know that a request came from a system ( non smart device ) like from desktop, laptop,etc. using navigator.userAgent.


You can test the userAgent value for the names of popular browsers! For example, the user agent string for the latest version of Firefox looks like this:

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2


Browser detection is bad. It's always better to opt for feature detection instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜