jQuery callback, anonymous or named separate function?

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?

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