function forient() { w = window.innerWidth; h = window.innerHeight; wh = "(" + w + " x " + h + ")"; // alert(wh) for (i = 1; i < 7; i++) { document.getElementById("Orientation_"+i).innerHTML = "ORIENTATION " + i + " " + wh; } } var isMobile = { Android: function () { return navigator.userAgent.match(/Android/i); }, iOS: function () { return navigator.userAgent.match(/iPhone|iPad|iPod/i); }, any: function () { return (isMobile.Android() || isMobile.iOS()) ; } }; if (isMobile.any()) {document.write("");} else { document.write("");} screen.orientation.addEventListener("change", (event) => { window.location.href='default.aspx' // const type = event.target.type; // const angle = event.target.angle; // console.log(`ScreenOrientation change: ${type}, ${angle} degrees.`); });