How to show loader for "Ajax call with async: false"?
I’m facing issue like loader is not showing when Ajax call is with async:false?
Add comment
Answers (2)
Add AnswerHello, @Riya Patel
You can do one thing to solve this problem. You can use setTimeout method for an ajax call. First show the loader then set the timeout of 1 second for the ajax call.
For example:
$('#loader').show(); setTimeout(function () { $.ajax({ method: "POST", url: "", dataType: "json", async: false, data: {}, success: function (data) { }, error: function (data) { } }); }, 100);
This solution is working fine..😀
Thank you @Chand Dakhara
Thank you for your answer
I’ve already tried this but it is not working.