Hi
I got acquainted with jQuery a few days back and am beginning to realize the little magic it can do.
I am curious to know how exactly a callback with arguments is executed in jQuery i.e. what is the exact execution sequence?
I went through the link http://docs.jquery.com/Tutorials:How_jQuery_Works
and it speaks of a wrong way i.e.
$.get('myhtmlpage.html', myCallBack(param1, param2));
and a right way i.e.
$.get('myhtmlpage.html', function(){
myCallBack(param1, param2);
});
In the first case, myCallBack would be executed first and then its return value would act as an argument to get. In the latter method, get would return a web page which would be acted upon by the myCallBack.
How does it work as syntactically both have myCallBack as being still an argument to get? I'm a bit confused on this.
cheers