Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>According to <a href="http://jquerymobile.com/demos/1.1.1/docs/api/events.html" rel="nofollow">jquerymobile docs</a> You should be using <code>$(document).bind('pageinit')</code>, not <code>$(document).ready()</code>. More over, when using phonegap, you need to bind to `deviceready'. </p> <p>Try changing your code to the following:</p> <pre><code>document.addEventListener("deviceready", onDeviceReady, true); $( document ).bind( "mobileinit", function(){ $.support.cors = true; $.mobile.allowCrossDomainPages = true; $.mobile.loadingMessageTextVisible = true; $.mobile.showPageLoadingMsg(); }); var onDeviceReady = function(){ $.support.cors = true; $.mobile.allowCrossDomainPages = true; e.preventDefault(); alert("test");//----------------------------------------------- $.ajax({ crossDomain: true, type: 'GET', url: 'http://ip/services/rest/contact/list', callback: 'jsonpCallback', jsonpCallback: 'jsonpCallback', jsonp: '_jsonp', contentType: 'application/json', dataType: 'jsonp json', timeout : 10000, success: function(data){ var html =''; alert("data.firstName"); $.each(data, function(key, data) { html += '&lt;li&gt;&lt;a class=contact href="#" &gt;&lt;h1&gt;' + data.label + '&lt;/h1&gt;&lt;p&gt;'+ data.customerName + '&lt;/p&gt;&lt;p&gt;' + data.phone + ', ' + data.email + '&lt;/p&gt;&lt;p&gt;' + data.id + '&lt;/p&gt;&lt;/a&gt;&lt;/li&gt;'; $('#ul_id').append($(html)); html=''; }); $('#ul_id').trigger('create'); $('#ul_id').listview('refresh'); }, error: function (xhr, ajaxOptions, thrownError){ alert("Status: " + xhr.status + ", Ajax option: " + ajaxOptions + ", Thrown error: " + thrownError); //location.reload(); }, }; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload