Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect mobile browser using jQuery or in some other SIMPLE way..? [duplicate]

Possible Duplicate:
best way to detect handheld device in jQuery

I want to make a mobile version of my web app. How I can run a function that will detect if a request is being made from a desktop or mobile browser?

This is so that if the user is requesting from a mobile browser and they click on a link, rather than go to the actual page, it should get hijacked and do some other event..

Thanks in advance..

like image 404
thedeepfield Avatar asked Feb 18 '11 19:02

thedeepfield


People also ask

How do you detect whether the website is being opened in a mobile device or a desktop in JavaScript?

Using CSS Media Queries, we can easily know that a user is currently viewing our website in which device (using min-width and max-width). It is only limited to styling web pages, but we can control the functionality of the website according to the user's device using the navigator userAgent Property in JavaScript.


1 Answers

There are a few scripts on Detect Mobile Browser that redirect mobile visitors on the server side or with JavaScript or jQuery.

like image 130
Chad Smith Avatar answered Oct 09 '22 09:10

Chad Smith