Hi Can anyone please tell me what a callback function is?
Thanks,
Vivek
Vivek Alampally
Ranch Hand
Joined: Jul 10, 2008
Posts: 65
posted
0
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
posted
0
1) A function that gets called when something is done running
2) Nothing
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
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