File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes What is a callback function? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "What is a callback function?" Watch "What is a callback function?" New topic
Author

What is a callback function?

Vivek Alampally
Ranch Hand

Joined: Jul 10, 2008
Posts: 65
Hi Can anyone please tell me what a callback function is?

Thanks,
Vivek
Vivek Alampally
Ranch Hand

Joined: Jul 10, 2008
Posts: 65
And, what is difference between a normal function & callback function? Kindly explain with a example.

Thanks
vivek
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 14857
1) A function that gets called when something is done running
2) Nothing
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12612
Just to add a bit: functions can be passed around in JavaScript. So you can pass a function to another function, which can then call the passed-in function later. Related to this concept are closures. To use JavaScript effectively it's really important to understand how all this works.
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 48842

If you have a copy of jQuery in Action, Appendix A covers this topic in depth.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Vivek Alampally
Ranch Hand

Joined: Jul 10, 2008
Posts: 65
Thank you all for helping me out.
 
 
subject: What is a callback function?
 
developer file tools