jQuery Callback Functions
JavaScript statements are executed line by line. However, with effects, the next line of code can be run even though the effect is not finished. This can create errors.
To prevent this, you can create a callback function.
A callback function is executed after the current effect is finished.
Typical syntax: $(selector).hide(speed,callback);
jQuery - Chaining
With jQuery, you can chain together actions/methods.
Chaining allows us to run multiple jQuery methods (on the same element) within a single statement.
jQuery Method Chaining
Until now we have been writing jQuery statements one at a time (one after the other).
However, there is a technique called chaining, that allows us to run multiple jQuery commands, one after the other, on the same element(s).
Tip: This way, browsers do not have to find the same element(s) more than once.
To chain an action, you simply append the action to the previous action.
jQuery Callback Functions
A callback function is executed after the current effect is 100% finished.
Nesta página do site você pode assistir ao vídeo on-line jQuery Latest Version Tutorials | Lecture 4 | Jquery Callback-Chaining|Tutorialspoint JavaScript duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Laugh and Learn 04 Novembro 2024, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 46 vezes e gostou 2 espectadores. Boa visualização!