i was wondering if there is away for my website check if the user is using a mobile browser then if the user is to execute javaquery, and if not to use normal JavaScript
Asked
Active
Viewed 33 times
0
-
1First, you have to define what is a "mobile browser". – Blazemonger Nov 23 '15 at 18:39
-
1You can use the [isMobile](https://github.com/kaimallea/isMobile) library – Alon Eitan Nov 23 '15 at 18:41
-
Maybe this is related? http://stackoverflow.com/questions/3514784/what-is-the-best-way-to-detect-a-mobile-device-in-jquery?rq=1 – Lucas Pottersky Nov 23 '15 at 18:41
-
there are multiple ways you can detect whether something is "mobile": - screen size - touch events - modernizr (hidden scrollbar) - browser agent you'll have to be more specific to what your definition of "mobile browser" is! – timeiscoffee Nov 23 '15 at 18:45
1 Answers
0
See: http://www.sitepoint.com/detect-mobile-devices-jquery/
Basically this should work:
if(jQuery.browser.mobile)
{
console.log('You are using a mobile device!');
}

csga5000
- 4,062
- 4
- 39
- 52