title: Using jQuery $.ajax, 'GET' method to display XML as HTML - only works in some browsers
body: <p>I am trying to pull data from an XML file into a website as HTML elements using the jQuery <code>$.ajax 'GET'</code> method, but it currently only works in two browsers using a local copy of jquery-1.9.1.min.</p>
  
  <p>This will work just fine in Chrome and Firefox, however in Opera, Safari, and all versions of IE nothing comes through.  Opera is the only browser that returns an error in the console: </p>
  
  <blockquote>
    <p>Uncaught exception: TypeError: Cannot convert 'n.innerHTML' to object.</p>
  </blockquote>
  
  <p>The function:</p>
  
  <pre><code>$(document).ready(function(){
    $.ajax({
      type: "GET",
      url: "content/pages.xml",
      crossDomain: true,
      dataType: "xml",
      success: function parseXml(xml){
        // find all page divs and load each into the main content area
        $(xml).find("page").each(function(){
          $("#contentArea").append($(this).find("mainPage").html());
        });
      }
    });
  });
  </code></pre>
  
  <p>The XML:</p>
  
  <pre><code> &lt;page&gt;
      &lt;mainPage&gt;
          &lt;div id="homePage" class="mainPage"&gt;&lt;!-- columns incomplete --&gt;
              &lt;div id="homePage_txtpart_010" class="txtpart"&gt;
                  &lt;p id="homePage_txt_010"&gt;For those who are tired of spending tens of thousands of dollars to advertise on Live-Stream programming, only to receive minimal or ineffective exposure, StreamYourAd.com offers 
                  a long overdue alternative to fruitless pre-roll ads. Take the guess work out of whether or not your ads reach your audience, and start paying less to attain more.&lt;/p&gt;
                      &lt;br /&gt;
                  &lt;p id="homePage_txt_020"&gt;When you partner with us, your ads...&lt;/p&gt;
                  &lt;ul id="homePage_lst_010"&gt;
                      &lt;li id="homePage_itm_010"&gt;Last longer&lt;/li&gt;
                      &lt;li id="homePage_itm_020"&gt;Cost less (less than a penny per view)&lt;/li&gt;
                      &lt;li id="homePage_itm_030"&gt;Can't be blocked, skipped or ignored&lt;/li&gt;
                      &lt;li id="homePage_itm_040"&gt;Reach a targeted, captivated audience&lt;/li&gt;
                      &lt;li id="homePage_itm_050"&gt;Reach mobile viewers&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
              &lt;div id="homePageColumns"&gt;
                  &lt;div id="homePageColumn_010" class="homePageCol"&gt;
                      &lt;h2 class="titles"&gt;Digital Branding&lt;/h2&gt;
                      &lt;p class="homePageColumns_txt"&gt;Embedded advertisements, logo blocks and digital PR.&lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div id="homePageColumn_020" class="homePageCol"&gt;
                      &lt;h2 class="titles"&gt;Social Solutions&lt;/h2&gt;
                      &lt;p class="homePageColumns_txt"&gt;Facebook development, Twitter development, surveys and fan feedback.&lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div id="homePageColumn_030" class="homePageCol"&gt;
                      &lt;h2 class="titles"&gt;Promotions and Endorsements&lt;/h2&gt;
                      &lt;p class="homePageColumns_txt"&gt;Product placement, streamer shout-outs, incentives and giveaways.&lt;/p&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/mainPage&gt;
  &lt;/page&gt;
  
  &lt;page&gt;
      &lt;mainPage&gt;
          &lt;div id="aboutPage" class="mainPage"&gt;
              &lt;div id="aboutPage_txtpart_010" class="txtpart"&gt;
                  &lt;p id="aboutPage_txt_010"&gt;StreamYourAd.com was created as an alternative to the stale forms of advertising currently offered in the Live-Streaming marketplace. Our goal is to get your message out to the masses.&lt;/p&gt;
                  &lt;p id="aboutPage_txt_020"&gt;Commercials are often ignored, skipped and even blocked. However, our process directly connects streamers with advertisers and ensures delivery of your message to live-streaming audiences worldwide.&lt;/p&gt;
                  &lt;p id="aboutPage_txt_030"&gt;Our ability to work with budgets big and small, create customizable service packages and employ streamers as advertisers makes working with StreamYourAd.com a partnership worth exploring.&lt;/p&gt;
                  &lt;p id="aboutPage_txt_040"&gt;Check out our list of services and contact us to see how we will help you reach your target audience every time.&lt;/p&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/mainPage&gt;
  &lt;/page&gt;
  
  &lt;page&gt;
      &lt;mainPage&gt;
          &lt;div id="servicesPage" class="mainPage"&gt;&lt;!-- includes four sub-pages; incomplete --&gt;
              &lt;div id="servicesPage_txtpart_010" class="txtpart"&gt;
                  &lt;p id="servicesPage_txt_010"&gt;services...&lt;/p&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/mainPage&gt;
  &lt;/page&gt;
  
  &lt;page&gt;
      &lt;mainPage&gt;
          &lt;div id="contactPage" class="mainPage"&gt;&lt;!-- needs forms and more contextual info --&gt;
              &lt;div id="contactPage_txtpart_010" class="txtpart"&gt;
                  &lt;p id="contactPage_txt_010"&gt;If you are an advertiser that is interested in having our streamers promote your business, a streamer interested in joining our Stream Team, or for any other inquiries you may have, please contact us and leave us your comments.&lt;/p&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/mainPage&gt;
  &lt;/page&gt;
  </code></pre>
  
  <p>The HTML:</p>
  
  <pre><code>            &lt;div id="contentArea"&gt;
                  &lt;!-- populated by xml data on document ready --&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>Have I missed something or is my syntax just off? I usually don't work with jQuery and XML in this way so don't be afraid to rip my code apart :)</p>