Suppose I have this as an option to a jQuery widget:
    function oneFunc()
    {
     var myVar;
       //there is some widget calling
       $.widget("ui.combobox", $.ui.autocomplete, {
                options: {
                       source: function (request, response){////doing something with myVar, request and response}
                }
       });
    }
Now I want to separate out the function (request, response) using callback
So, I want something like this:
function oneFunc()
{
     var myVar;
     //there is some widget calling
        $.widget("ui.combobox", $.ui.autocomplete, {
                options: {
                       source: myCallBack
       });
}
function myCallBack(request, response){
//I can get request and response here by default but not myVar
//doing something with myVar, request and response
}
So, I can't access myVar. I have to pass it there. but how to do that?
EDIT:
I don't want to use global variables
request, response are default values that I can get in myCallBack anyway.
Better if anonymous function can be avoided.
 
     
    