title: Prevent orientation change in iOS Safari
body: <p>Is it possible to avoid transition to landscape view in Safari for iOS when the device is rotated?</p>
  
  <p>iOS Safari has the "orentationchange" event, I tried to intercept it and disable the default behavior, like this:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  function changeOrientation(event) {
      alert("Rotate");
      event.preventDefault();
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onorientationchange="changeOrientation(event);"&gt;
  PAGE CONTENT
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>but when testing the page on my iPhone, when I rotate the device the alert is shown, but the view switch to landscape. It seems that event.preventDefault() does not stops the rotation.</p>
  
  <p>Is there a way to block this behavior?</p>