Link to home
Start Free TrialLog in
Avatar of KaranGupta
KaranGupta

asked on

this.callback javascript

Hi

As per my knowledge

 var my_alert = function ShowAlert() {  
            alert("This is the test message");  
        }  
        my_alert();  

Open in new window


is call back but I am not sure what is this,callback().

Please advice.

Regards
Karan Gupta
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Please show some context.
check this link for some good discussion
http://stackoverflow.com/questions/483073/getting-a-better-understanding-of-callback-functions-in-javascript

example that you posted is more of a delegation than callback.
Callback is mostly used for asynchronous execution to make sure that there is some method waiting for execution when the original method returns back.

For example, call back methods for ajax calls
ASKER CERTIFIED SOLUTION
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial