i have the following jquery code running on my page just fine in FF and IE, but chrome seems to be freaking out..
in FF and IE the call is made and the result is appended to the div. in chrome, it calls ajaxfailed on failure.
the XMLHttpRequest passed to the AjaxFailed function has a status code of "200" and the statusText is "ok". the readystate is 4 and the responseText is set to the data i wish to append to the div.. basically from what i can see its calling the failure method but it isn't failing.. i have tried with both get and post requests and it always breaks in chrome.
function getBranchDetails(contactID, branchID) { $.ajax({ type: "GET", url: urlToRequestTo, data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: branchDetailsSuccess, error: AjaxFailed }); } function branchDetailsSuccess(result) { $("#divBranchControl").empty(); $("#divBranchControl").append(" " + result); $("#branchDiv").tabs(); } function AjaxFailed(result) { alert("FAILED : " + result.status + ' ' + result.statusText); }
In the AJAX operation just add: async: false after datatype: "json" , and that should solve your problem. Chrome has issue handling asynchronous calls. Show activity on this post.
Ajax is supported in all modern browsers. We suggest using the following browsers: Google Chrome. Mozilla Firefox.
version added: 1.0.Whenever an Ajax request completes with an error, jQuery triggers the ajaxError event. Any and all handlers that have been registered with the . ajaxError() method are executed at this time.
In the AJAX operation just add: async: false
after datatype: "json"
, and that should solve your problem. Chrome has issue handling asynchronous calls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With