function redirectByMobileOS() { var userAgent = navigator.userAgent || navigator.vendor || window.opera;//for Android if (/android/i.test(userAgent)) { window.location.href = "http://www.android.com"; }//For iPhone / iPad / iPod (iOS if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { window.location.href = "http://www.apple.com"; } //Others else { window.location.href = "https://book.melkior.be"; } }