title: jQuery.ajax gives "TypeError: Cannot read property 'documentElement' of null" on server but not local
body: <p>I'm having a problem with my jQuery code on <a href="http://alpha.spherecat1.com/" rel="nofollow noreferrer">http://alpha.spherecat1.com/</a>, but the local copy works fine. As you can see if you visit the site now, the ajax call gives the following error:</p>
  
  <p>"TypeError: Cannot read property 'documentElement' of null"</p>
  
  <p>I've checked and rechecked and reuploaded everything I can think of. The documentation said to make sure I was sending the right MIME type, which I did to no avail. Here's the offending code:</p>
  
  <pre class="lang-js prettyprint-override"><code>function changePageAJAX(newPage, method)
  {
      if (method != "replace")
      {
          window.location.hash = newPage;
      }
      newPage = newPage.substring(1); // Remove the hash symbol.
      title = "SphereCat1.com | " + fixCase(newPage.replace(/\//g, " &gt; ")); // Set the window title.
      newPage = "ajax/" + newPage + ".html"; // Add path.
      if (newPage == currentPage)
      {
          return; // Don't let them load the current page again.
      }
      $.ajax({ // jQuery makes me feel like a code ninja.
          url: newPage,
          dataType: "xml",
          success: function(data, status, xmlhttp){ renderPage(xmlhttp); },
          error: function(xmlhttp, status, error){ alert(error); renderPage(xmlhttp); }
      });
      document.title = title;
      currentPage = newPage;
  }
  </code></pre>
  
  <p>It then goes on to render the page into a div. The pages it's grabbing are visible in the /ajax folder at the previous url. Any help you can provide would be greatly appreciated!</p>