Created
May 27, 2019 08:34
-
-
Save PhompAng/eb5ee28ca46eabde8e64b23a19198d60 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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title> | |
Techsauce | Tech and Biz Ecosystem Leader for Startups Technologies and Business | |
</title> | |
<script> | |
function getMobileOperatingSystem() { | |
var userAgent = navigator.userAgent || navigator.vendor || window.opera; | |
// Windows Phone must come first because its UA also contains "Android" | |
if (/windows phone/i.test(userAgent)) { | |
return "Windows Phone"; | |
} | |
if (/android/i.test(userAgent)) { | |
return "Android"; | |
} | |
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { | |
return "iOS"; | |
} | |
return "unknown"; | |
} | |
</script> | |
<script> | |
function DetectAndServe() { | |
var os = getMobileOperatingSystem(); | |
console.log(os); | |
if (os == "Android") { | |
window.location.href = "https://play.google.com/store/apps/details?id=com.wongnai.android"; | |
} else if (os == "iOS") { | |
window.location.href = "https://itunes.apple.com/th/app/wongnai/id403745899?mt=8"; | |
} else { | |
window.location.href = "https://techsauce.co"; | |
} | |
} | |
</script> | |
<body onload="DetectAndServe()"></body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment