Created
December 11, 2013 16:25
-
-
Save davidthingsaker/7913585 to your computer and use it in GitHub Desktop.
JavaScript and JQuery device detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JavaScript | |
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { | |
// some code.. | |
} | |
// JQuery | |
$.browser.device = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment