jQuery Latest Version Tutorials | Lecture 4 | Jquery Callback-Chaining|Tutorialspoint JavaScript

Published: 04 November 2024
on channel: Laugh and Learn
46
2

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.


On this page of the site you can watch the video online jQuery Latest Version Tutorials | Lecture 4 | Jquery Callback-Chaining|Tutorialspoint JavaScript with a duration of hours minute second in good quality, which was uploaded by the user Laugh and Learn 04 November 2024, share the link with friends and acquaintances, this video has already been watched 46 times on youtube and it was liked by 2 viewers. Enjoy your viewing!