window.addEventListener("orientationchange", function() { console.log("the orientation of the device is now " + screen.orientation.angle);});