jQuery callback, anonymous or named separate function?

jQuery callback, anonymous or named separate function?
0.0 0

#1

Hey guys I have run into a problem with callback functions in jQuery. If I pass a function litteral as a parameter to an ajax handler it has access to all the enclosing function’s local variables, but when I create a separate named function and pass it as a parameter it doesn’t.
Can anyone explain to me why? What did I miss?


#2

Could you write up an example so everyone is on the same page?