Monday, 18 April 2016

What is JQuery Callback Function

What is JQuery Callback Function?

A call back function executed after the current event has completed. Java Script code executes line by line. However, if next line of code executes even before completing the action(s) which wrote in previous lines. This may create an error.



To avoid this we can create aa callback function Below is a sample script for Jquery Callback function.

<script>
        $(document).ready(function () {
            $("button").click(function () {
                $("p").hide("slow", function () {
                    alert("This line is now hide.");
                });
            });
        });

</script>
Disqus Comments