Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplaying dynamic listviews on android device using PhoneGap and jQuery Mobile
    primarykey
    data
    text
    <p>I have a problem with my code. It works in Chrome, but does not on Android, even alert("test") never gets called. I made apk using PhoneGap. I also use jQuery Mobile. What am I missing? Is there any other way to make a dynamic listview out of data from json response?</p> <p>Thank you for answering.</p> <pre><code>$( document ).bind( "mobileinit", function(){ $.support.cors = true; $.mobile.allowCrossDomainPages = true; $.mobile.loadingMessageTextVisible = true; $.mobile.showPageLoadingMsg(); }) $( document ).ready(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> <p>});</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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