How can I get the user state in Javascript callback function ? Like I have a Javascript funciton making an asynchronous call as follows. Now In callback function I need to access userstate. How can I do this? In Silverlight we have userstate kind of thing. Do we have same kind of mechanism in Javascript as well. Please assist.
Note: I dont want to make use of Global variable as Func1() will be executed in a For Loop.
function Func1() {
var userState = "someValue";
geocoder.asyncCall(parameters , CallBack);
}
function CallBack(result) {
// Use result
// How to access userState in this function
}