Created
August 3, 2012 04:47
-
-
Save braddown/3244471 to your computer and use it in GitHub Desktop.
Link for App Download - Mobile OS Detection and Redirect Download Link to Appropriate App Store
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>Redirect</title> | |
<script type="text/javascript"> // <![CDATA[ | |
//iPhone Version: | |
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) { | |
window.location = "http://goo.gl/IWd7J"; | |
} | |
//Android Version: | |
if(navigator.userAgent.match(/android/i)) { | |
window.location = "http://goo.gl/1K1Hi"; | |
} | |
//Blackberry Version: | |
if(navigator.userAgent.match(/blackberry/i)) { | |
window.location = "http://goo.gl/jH2wD"; | |
} | |
</script> | |
</body> | |
</html> |
Sorry for a stupid question, how can I add button that will trigger the script? =)
Awesome!!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any idea about close tab or clear url automatically after redirection?