JQuery Code Not In Header, But AJAX Request Doesn't Work
<p>After a lot of searching many other posts, this should work, but it doesn't.</p>

<p>JQuery Mobile documentation says I've properly placed the code below to allow for the ajax request, and it works fine with a standard http request, but when I click on a link pointed back to this page, the ajax request fails to include the inserted content. I'm so new to javascript and jquery that the pageInit() explanations aren't getting me anywhere, either.</p>

<p>Here's the code:</p>

<pre><code>&lt;div data-role="page" id="indexPage" class="page" data-dom-cache="false"&gt;

&lt;script&gt;
jQuery(function($){
$('#mobile1').load('/index.html #homeStats').trigger('create');
});

&lt;/script&gt;

&lt;script&gt;
jQuery(function($){
  $('#mobile2').load('/index.html #homeStats2');
  });

&lt;/script&gt;
// then farther down the page
&lt;div id="mobile1"&gt; &lt;/div&gt;
// and still farther down the page
&lt;div id="mobile2"&gt; &lt;/div&gt;
</code></pre>

<p>With an http request these two jquery functions are successfully grabbing content from the homepage of my site and inserting that content into the index.html page of the mobile version in the mobile folder.</p>

<p>But this does not work when this page is requested from another page in the mobile folder, unless data-ajax="false" is included in the link (which is the way I have it until I can fix this issue). </p>

<p>Why doesn't my code work as is? My code is <em>not</em> in the header, it's inside the div data-role="page" as recommended.</p>

<p>Here is my site <a href="http://dentonrainfall.com/" rel="nofollow">http://dentonrainfall.com/</a> if it helps illuminate my ignorance, but it re-directs you to the non-mobile version if you don't access it from a phone.</p>
