Reputation: 113
If I am running same code in Mozilla (aprt from Chrome browser) its working fine but in Google Chrome its not working because of async: false
If I am making async: true
then its working but need to reload the page.So how to handle this in Chrome browser
var submitpage = function () {
var loading_dev = 'body';
run_waitMe(loading_dev);
$.ajax({
url: window.updatetestUrl + "?v=" + Math.random(),
type: "get",
dataType: "json",
async: false,
success: function (response) {
//run_waitMe_close(loading_dev);
},
error: function () {
// run_waitMe_close(loading_dev);
}
});
};
Upvotes: 0
Views: 1098
Reputation: 54
Are you sure you want to make your request non-asyncronous? AJAX stands for Asynchronous JSON and XML HTTP requests. As an async request, your call is going to be sent off without caring about its effect or result. The call will be sent out and then the line of code under it will be executed without caring about your call's response.
If you want your code to do something after your request is finished, you need to define it in your success function (and maybe uncomment run_waitMe_close).
success: function (response) {
run_waitMe_close(loading_dev);
//Do other desired work here
},
Upvotes: 1