title: phonegap uncaught syntaxerror unexpected token < (phonegap + wp json api)
body: <p>I tried to put a an Android phonegap app with WP serving content. while phonegap app running JQM framework. I did this a couple of time and it worked fine.</p>
  
  <p>However, in this new app i did, i had this <strong>uncaught syntaxerror unexpected token &lt;</strong> </p>
  
  <p><strong>My codes to retrieve json</strong></p>
  
  <pre><code>function loadWPCatIndex() {
      $.getJSON("http://www.skywin.my/?json=get_category_index&amp;callback=?", function(data){
          console.log(data);
          plistmenu = $('#product_list');
          $.each(data.categories.reverse(), function(i, item) {
              categoriesID[i] = {wpcatname: item.title, wpcatid: item.id, wpcatparent: item.parent};
          });
  
          $.each(categoriesID, function(i, item) {
              if (item.wpcatparent == 0) {
                  plistmenu.append('&lt;option value ="'+item.wpcatname+'" data-pcatid="'+item.wpcatid+'"&gt;'+item.wpcatname+'&lt;/option&gt;');
              }        
          });
  
          $.each(categoriesID, function(i, item) {
              if (item.wpcatparent != 0) {
                  $('#product_list option[data-pcatid="'+item.wpcatparent+'"]').after('&lt;option value ="'+item.wpcatname+'" data-pcatid="'+item.wpcatid+'"&gt; - '+item.wpcatname+'&lt;/option&gt;');
              }
          });
          plistmenu.children(':first').attr('selected','selected');
          $('#product-page-loader').hide();
          InitMenuEvent();
          $('#product-menu').fadeIn();
      });
  
  }
  </code></pre>
  
  <p><strong>Json response in browser</strong></p>
  
  <pre><code>?({"status":"ok","count":4,"categories":[{"id":4,"slug":"accessories","title":"Accessories","description":"","parent":0,"post_count":1},{"id":8,"slug":"handsfree-kit","title":"Handsfree Kit","description":"","parent":4,"post_count":1},{"id":5,"slug":"nokia","title":"Nokia","description":"","parent":3,"post_count":1},{"id":3,"slug":"phones","title":"Phones","description":"","parent":0,"post_count":1}]})
  </code></pre>
  
  <p>All this work fine if i run it as a webapp in the browser. But when i compiled it to android app, i get the error <strong>Uncaught syntaxerror: unexpected token &lt;</strong></p>
  
  <p>Full Error Message</p>
  
  <p>Web Console | Uncaught SyntaxError: Unexpected token &lt; at <a href="http://mydomain.my/?json=get_category_index&amp;callback=jQuery18207101479058610589_1357737767961&amp;_=1357737767978:1" rel="nofollow noreferrer">http://mydomain.my/?json=get_category_index&amp;callback=jQuery18207101479058610589_1357737767961&amp;_=1357737767978:1</a></p>
  
  <p><em>Edit</em> Added Screenshot link as suggested by <em>ninetwozero</em> Thanks :)
  <a href="https://hosted.vinnetwork.com/unexpectedtoken.png" rel="nofollow noreferrer">Screen Shot</a>
  <img src="https://hosted.vinnetwork.com/unexpectedtoken.png" alt="https://hosted.vinnetwork.com/unexpectedtoken.png" /></p>
  
  <p>Would appreciate if anyone could really come into help. Appreciate. </p>
  
  <p>P.s. I run similar code in other domain for other app, it works though.</p>