title: jquery Ajax GET jsonp request from wordpress script
body: <p>I'm building a script for a phonegap app and i am using jquery and ajax to grab some json from my wordpress site and display it. The script i have isn't displaying any content and the console isn't showing any errors, so maybe one of the pros could help me out here:</p>
  
  <p>LIST PAGE (HTML):</p>
  
  <p><code>&lt;ul data-role="listview"  id="post-list"&gt;&lt;/ul&gt;</code></p>
  
  <p>SINGLE POST PAGE (HTML):</p>
  
  <p><code>&lt;ul data-role="listview"  id="post-data"&gt;&lt;/ul&gt;</code></p>
  
  <p>JavaScript:</p>
  
  <pre><code> $(document).on('pageinit', '#home', function () {
  
       $.ajax({
           url: 'http://chris.floppytron.com/api/get_recent_posts/',
           dataType: "jsonp",
           success: function (result) {
               ajax.parseJSONP(result);
           },
           error: function (request, error) {
               alert('Network error has occurred please try again!');
           }
       });
   });
  
   $(document).on('pagebeforeshow', '#headline', function () {
       $('#post-data').empty();
       $.each(postInfo.result, function (i, row) {
           if (row.id == postInfo.id) {
               $('#post-data').append('&lt;li&gt;' + row.title + '&lt;/li&gt;');
               $('#post-data').append('&lt;li&gt;' + row.date + '&lt;/li&gt;');
               $('#post-data').append('&lt;li&gt;' + row.categories + '&lt;/li&gt;&lt;br /&gt;');
               $('#post-data').append('&lt;li&gt;' + row.content + '&lt;/li&gt;');
               $('#post-data').listview('refresh');
           }
       });
   });
  
   $(document).on('vclick', '#post-list li a', function () {
       postInfo.id = $(this).attr('data-id');
       $.mobile.changePage("#headline", {
           transition: "slide",
           changeHash: false
       });
   });
  
   var postInfo = {
       id: null,
       result: null
   }
  
   var ajax = {
       parseJSONP: function (result) {
           postInfo.result = result.results;
           $.each(result.results, function (i, row) {
               console.log(JSON.stringify(row));
               $('#post-list').append('&lt;li&gt;&lt;a href="" data-id="' + row.id + '"&gt;&lt;img src="' + row.thumbnail + '"/&gt;&lt;h3&gt;' + row.title + '&lt;/h3&gt;&lt;p&gt;' + row.categories + '&lt;/p&gt;&lt;br /&gt;&lt;p&gt;' + row.date + '&lt;/p&gt;&lt;/a&gt;&lt;/li&gt;');
           });
           $('#post-list').listview('refresh');
       }
   }
  </code></pre>