Search code examples
javascriptjqueryajaxanimationwait

jquery: animation must go on (animation and sync ajax request)


all!

I use the following code: 1) activate animations. eg:

$( ". Wait-screen"). FadeTo (250, 1.0);

2) sending a request to the server and waiting for a reply:

$.ajax(async: false, ...);

When begins to execute a request to the server all the stops - the animation is not running, but as soon as the request is completed - all runs

How to make so that during synchronous request (async: false) animation in the browser worked?


Solution

  • Synchronous means only one line of code can run at a time. So the request your making will block all other code until it is finished. You're going to have to set async: true for it to be non-blocking.