Evaluation order in JavaScript using Ajax?

It seems (to me) how javascript statements do not always run one after another. I know that they do this, but sometimes it seems that the show () function works simultaneously with hide (), so the logic fails. Callback functions exist, for example jQuery.load ("some.html", thenrunthis) ..

I need to understand working logic. any help / leads?

thanks in advance

+3
source share
6 answers

Are you really asking about "A" in AJAX . It means asynchrony and allows you to make a request without blocking . The callback function will be executed if / when the request is successful, but the rest of your code continues. One of the main advantages of this approach is the responsiveness of the user interface. A synchronous call will significantly freeze the browser until your request returns, which may take some time.

: , , , AJAX. , , jQuery, jQuery Events API .

: , , . , jQuery documentation, input, :

$("input").focus(function () {
     $(this).next("span").css('display','inline').fadeOut(1000);
});

. , input . .

+6

javascript, , , , , . .

. wikipedia.

+2

, jQuery.load - .

​​, , . , : " , , , . , - "

?

+1

, .

. javascript html-. , . , javascript , ? , . .

. x, , , , script . . , , , , . .

?

+1

, , javascript . javascript HTML.

- javascript. , (, " " ).

+1

, . - , JavaScript, , .

jQuery.load("some.html",thenrunthis);

thenrunthis some.html , ,

-1

Source: https://habr.com/ru/post/1714067/


All Articles