jquery - Why this script can't call the web services -
this part of code of practice of mobile apps written using phonegap & jquerymobile.
$('#page_node_pages').live('pageshow',function(){ try { $.ajax({ url: "http://mydomain/industry", type: 'get', datatype: 'json', error: function (xmlhttprequest, textstatus, errorthrown) { alert('page_node_pages - failed retrieve pages'); console.log(json.stringify(xmlhttprequest)); console.log(json.stringify(textstatus)); console.log(json.stringify(errorthrown)); }, success: function (data) { $("#page_node_pages_list").html(""); $.each(data.nodes,function (node_index,node_value) { console.log(json.stringify(node_value)); $("#page_node_pages_list").append($("<li></li>",{"html":"<a href='#page_node_view' id='" + node_value.node.nid + "' class='page_node_pages_list_title'>" + node_value.node.name + "</a>"})); }); $("#page_node_pages_list").listview("destroy").listview(); } }); } catch (error) { alert("page_node_pages - " + error); } }); if compile mobile apps, call web service. if try run using chrome on desktop computer, wonn't call web service. know problem?
you have run (local) server opposed running file. chrome behaves differently local files loaded directly browser. ajax calls local files might not work default.
Comments
Post a Comment