Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Jquery callback function

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 415
    Comment on it

    Hello Readers,


    In jQuery, It is a function which is passed as an argument to another function and it is executed when/after it's parent function has been completed.


    Callbacks are some special jQuery function because it patiently wait to execute until it's parent function finishes. Meanwhile, the browser can execute some other jQuery functions or do all sorts of the other work.


    Typical syntax: $(selector).hide(speed,callback);


    The following example has a callback parameter which is a function that will be executed when the hide effect is complete:

    $("button.click").click(function(){
        $("p").hide("slow", function(){
            alert("The paragraph is now hidden!");
        });
    });
    


    The above example hide is a method where function is a callback function.


    Thanks


 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: