T
T
ThreegunD2018-02-14 19:22:22
JavaScript
ThreegunD, 2018-02-14 19:22:22

Synchronous request blocks preloader()?

In general, there is code like
the ajax request function () {
here requests are processed synchronously in a cycle
}

the preloader function () {
here the inscription "Loading" is simply hung on the body and darkens the background.
}

button.click(
preloader()
ajax requests()
);

The trouble is that the requests are processed, but the preloader never appears. Tried to put in beforeSend, and in requests, nothing helps.
BUT as soon as I remove async: false and translate it to true, the preloader is shown.
It also works if I just enter the preloader display code into the console.
Has anyone experienced this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kn1ght_t, 2018-02-14
@kn1ght_t

Why synchronously send requests?
do something like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question