getJSON function works only when ajax page loading is turned off

getJSON function works only when ajax page loading is turned off

I struggled with this so initially I gave up and turned off ajax page loading for jQuery Mobile ($.mobile.ajaxEnables = false;) and (data-ajax="false").  I basically finished my website but I REALLY WANT TO USE AJAX LOADING!!!  

My problem is when going from index.html (topics page) to news.html, and going from news.html to newstext.html, the javascript ajax calls, which should get data from my database and fill the page, aren't getting executed.  There are no errors in the console.  Here's my code...PLEASE HELP ME FIX THIS!!!

INDEX.HTML
  1. <!DOCTYPE HTML>
  2. <HTML>
  3. <head>
  4. <meta charset="UTF-8"/>
  5. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  6. //3 files here for jquery, mobile and css
  7. </head>
  8. <body>
  9.       <div data-role="page" id="home">
  10.                   <div data-role="content">
  11.                 <div class="ui-grid-solo">
  12.             <div class="ui-block-a"><a class="ui-bar ui-bar-e" data-ajax="false" href="news.html" style="text-align:center" data-inline="false">Main News</a></div>
  13.             </div>
  14.                   </div>
  15. </div>
  16. </body>
  17. </HTML>
NEWS.HTML
  1. <body>
  2. <div data-role="page" id="mainNews">
  3.             <div data-role="content">
  4.                   <ul class="stuff"  id="fnews" data-role="listview" data-theme="c">
  5. <li style="text-align:center" data-role="list-divider">Daily Topic</li>
  6.   </ul>
  7.             </div>
  8.       </div>
  9. <script src="js/getmainnews.js"></script>
  10. </body>
GETMAINNEWS.JS
  1. var serviceURL = "http://localhost/basket/services/";
  2. $('#mainNews').on('pageinit', function(event) {
  3. $.mobile.ajaxEnabled = false;
  4. getNews();
  5. });
  6. function getNews() {
  7. $.getJSON(serviceURL + 'getmainnews.php', function(data) {
  8. daily = data.items;
  9.             $.each(daily, function(index, news) {
  10. $('#fnews').append('<li data-icon="false"><a style="white-space:normal;" href="newstext.html?url=' + news.link + '">' + news.pic + news.article + '</a></li>');
  11. });
  12.             $('#fnews').listview('refresh');
  13.       });
  14. }
It works when ajax is turned off perfectly.  When it's on, after clicking on Main News, in the console (Chrome) the XHR returns news.html, not the php file (getmainnews.php).  When it's off, it returns the php file.  I tried changing the location of the js, I tried changing on('pageinit') to bind and to live and nothing helped.  Why isn't the ajax call working?  Please take some time and help me out!!!