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 errors.




To avoid this we can create a callback functions. 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>

Comments

Popular posts from this blog

CAML Query in SharePoint 2010

Calling REST APi from server side code - C#

All about SharePoint 2010 Content Type Hub

SharePoint Interview Questions and Answers

Calling ASP.Net WebMethod using jQuery AJAX