Created
September 16, 2012 11:10
-
-
Save Pushplaybang/3732015 to your computer and use it in GitHub Desktop.
basic mobile phone detection - still to test
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 type="text/javascript"> | |
$(document).ready(function () { | |
var deviceAndroid = "android"; | |
var deviceIphone = "iphone"; | |
var deviceBlackberry = "blackberry"; | |
var uagent = navigator.userAgent.toLowerCase(); | |
DetectDevice(); | |
function DetectDevice() { | |
if (uagent.search(deviceAndroid) > -1) {} | |
else if (uagent.search(deviceIphone) > -1) {} | |
else if (uagent.search(deviceBlackberry) > -1) {} | |
else { } | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment