Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- if (getMobileOperatingSystem() === "Android") {
- window.location.href = //link for android
- }
- if (getMobileOperatingSystem() === "iOS") {
- window.location.href = //link to ios
- }
- function getMobileOperatingSystem() {
- var userAgent = navigator.userAgent || navigator.vendor || window.opera;
- 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";
- }
- if (/BB10|playbook/i.test(userAgent)) {
- return "Black Berry"
- }
- if (/nokia/i.test(userAgent)) {
- return "Nokia";
- }
- return userAgent; //default ua
- }
- </script>
Add Comment
Please, Sign In to add comment