[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

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
0
KaranGupta
Asked:
KaranGupta
3 Solutions
 
Michel PlungjanIT ExpertCommented:
Please show some context.
0
 
Gurvinder Pal SinghCommented:
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
0
 
Gurvinder Pal SinghCommented:
0
 
h4hardyCommented:
Hi karan,

here is the good article to get the better idea about the callback function JavaScript,

http://pietschsoft.com/post/2008/02/JavaScript-Function-Tips-and-Tricks.aspx
0
 
Kishan ZunjareCommented:
Callback functions are used in JavaScript (JS) extensively. They are required for AJAX/XHR, event handling, and in popular JS libraries.

http://onemarco.com/2008/11/12/callbacks-and-binding-and-callback-arguments-and-references/
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now