title: jQuery Mobile adding javascript is disabling ajax
body: <p>I have a mobile javascript ad tag which uses the document.write function. This runs in the fixed header of each page. My problem is jqm will only initalize on the first page you view with the ad tag. When i navigate to page 2, the page shows as blank. If i refresh the blank page, all content, including the ad, will show.</p>
  
  <p>I disabled ajax myself using <em>$.mobile.ajaxEnabled=false;</em> and that obviously works but it kinda defeats the purpose of JQM.</p>
  
  <p>Here is my code. Page 2 is exactly the same except for the page id.</p>
  
  <pre><code>&lt;div data-role="page" id="page1"&gt;
  
  &lt;div data-role="header"&gt;
  &lt;script language="javascript"&gt;
  &lt;!--
  document.write('&lt;scr'+'ipt language="#"&gt;&lt;/scri'+'pt&gt;');
  //--&gt;
  &lt;/script&gt;
  &lt;/div&gt;
  
  &lt;div data-role="content"&gt;
  &lt;p&gt;content text&lt;/p&gt;
  &lt;p&gt;&lt;a href="page2.php"&gt;Page 2&lt;/a&gt;&lt;/p&gt;
  &lt;/div&gt;
  
  &lt;div data-role="footer"&gt;
  footer text
  &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Demo</strong>
  <a href="http://capitalnewmediafiles.co.uk/stack/page1.php" rel="nofollow">http://capitalnewmediafiles.co.uk/stack/page1.php</a>
  (ad only displays in mobile)</p>
  
  <p>Can anyone point me in the right direction to get the framework loading properly across all pages with the ad tag without disabling ajax.</p>
  
  <p>Many thanks</p>