title: Javascript Orientation Change doesn't work with PhoneGap on iPad
body: <p>I'm adapting a small HTML/CSS/Javascript driven web magazine as an iApp for the iPad with the great mobile framework PhoneGap. Everything works great, except the orientation change from portrait to landscape mode.</p>
  
  <p>I use the following Javascript code in the header of the index.html (portrait):</p>
  
  <pre><code>  var isiPad = navigator.userAgent.match(/iPad/i) != null;
    var isiPhone = navigator.userAgent.match(/iPhone/i) != null;
  
    function updateOrientation() {
     if (isiPad || isiPhone) {
      switch (window.orientation) {
       case 90:
        window.location = "index_landscape.html";
        break;
       case -90:
        window.location = "index_landscape.html";
        break;
      }
     }
    }
  </code></pre>
  
  <p>with the following body tag:</p>
  
  <pre><code>&lt;body onorientationchange="updateOrientation();"&gt;
  </code></pre>
  
  <p>If I rotate the iPad to landscape mode, it doesn't change to index-landscape.html.</p>
  
  <p>Does anybody know where the problem is? 
  Isn't it possible to change the HTML file, while changing orientation within the PhoneGap framework? 
  With other words, can I only use <strong>one</strong> HTML file (index.html) with PhoneGap and have to use CSS for the orientation change?</p>
  
  <p>If I check out the app as a website with the iPad Safari browser, the orientation change works properly.</p>
  
  <p>Thanks for any help!</p>