javascript - Ajax calls in jquery getting error:0 -
i making ajax call used in jquerymobile. working fine in local host , when uploaded in server, ajax call returned error:0
code: $(document).on('pageinit', '#joblist', function(){ if (navigator.online) { $.ajax({ type: "get", url: "http://sample.com/jobs", headers:{authorization:authheader}, datatype: "xml", success: function(xml) { xmljoblist=xml; localstorage.removeitem("joblist"); var xmlstring = (new xmlserializer()).serializetostring(xml); window.localstorage.setitem("joblist", xmlstring); viewjoblist(xml); }, error: function(result) { alert("an error occurred while processing xml file."); console.log("error" + result.status + result.statustext); //result.status:0 } }); } });
Comments
Post a Comment