Created
July 8, 2015 20:10
-
-
Save AskYous/e87bb0bc9f6e0bd6902d to your computer and use it in GitHub Desktop.
Detect if User is on iPhone or Android
This file contains hidden or 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
function detectBrowser() { | |
var useragent = navigator.userAgent; | |
var mapdiv = document.getElementById("map-canvas"); | |
if (useragent.indexOf('iPhone') != -1 || useragent.indexOf('Android') != -1 ) { | |
console.log('You are on an Android or iPhone!'); | |
} else { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment