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.
На этой странице сайта вы можете посмотреть видео онлайн jQuery Latest Version Tutorials | Lecture 4 | Jquery Callback-Chaining|Tutorialspoint JavaScript длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Laugh and Learn 04 Ноябрь 2024, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 46 раз и оно понравилось 2 зрителям. Приятного просмотра!