Detect iPad users using jQuery?
问题 Is there a way to detect if the current user is using an iPad using jQuery/JavaScript? 回答1: iPad Detection You should be able to detect an iPad user by taking a look at the userAgent property: var is_iPad = navigator.userAgent.match(/iPad/i) != null; iPhone/iPod Detection Similarly, the platform property to check for devices like iPhones or iPods: function is_iPhone_or_iPod(){ return navigator.platform.match(/i(Phone|Pod))/i) } Notes While it works, you should generally avoid performing