What is the most reliable way to detect a mobile device using Modernizr?
问题 I am developing a responsive site and I have been asked to swap any freephone numbers on our site to the landline equivalent when a user is browsing on a mobile device. What is the most reliable way to detect if a user is on a mobile device using the Modernizr library (or any other library)? I am aware of Modernizr.touch and also Modernizr.geolocation. When the two are combined in an if(Modernizr.touch && Modernizr.geolocation) statement they are a good indicator of whether you are on a