Created
March 9, 2016 09:03
-
-
Save LaurentFough/bfc31a58cc184a2dc0a6 to your computer and use it in GitHub Desktop.
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
<script> | |
var ua = navigator.userAgent; | |
var checker = { | |
ios: ua.match(/(iPhone|iPod|iPad)/), | |
blackberry: ua.match(/BlackBerry/), | |
android: ua.match(/Android/), | |
windowsphone: ua.match(/Windows Phone/) | |
}; | |
$(document).ready(function() { | |
if (checker.ios) { /* iOS Code */ } | |
else if (checker.blackberry) { /* BlackBerry Code */ } | |
else if (checker.android) { /* Android Code */ } | |
else if (checker.windowsphone) { /* Windows Phone Code */ } | |
else { /* Everything Else */ } | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment