Which approach is more reliable to detect a mobile browser?
-
UA sniffing
-
Jquery’s
width()
As I understand UA sniffing is not very reliable.
I need to change the HTML for a page according to the width of the mobile device viewing the page. I can’t do that with media queries alone.
You can use the mobile detect JS library to do this. Take note of the warning: