Solved

this.callback javascript

Posted on 2011-09-14
5
190 Views
Last Modified: 2012-05-12
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
Comment
Question by:KaranGupta
5 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
Please show some context.
0
 
LVL 40

Expert Comment

by:gurvinder372
Comment Utility
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
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 167 total points
Comment Utility
0
 
LVL 4

Assisted Solution

by:h4hardy
h4hardy earned 167 total points
Comment Utility
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
 
LVL 7

Assisted Solution

by:Kishan Zunjare
Kishan Zunjare earned 166 total points
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now