Area #2: Passing thru the execution's scope (this)

Dispatcher Initialization:

YAHOO.util.Dispatcher.fetch ('myCustomPort2', 'tabs/getting-params2.html', 
// configuration object
{
after: function(area) {
myRemoteMethod2.apply(this, []);
},
foo: 'param1',
boo: 'param2',
obj: {tee:1, loo: 2}
}
);

Source Code:

// using the window.myFunction you can force to define a global function, avoid it...
// instead you can use the yahoo namespace, for example (YAHOO.example.myFunction)
window.myRemoteMethod2 = function() {
console.log ('Function: myRemoteMethod2');
console.log ('Scope: ', this);
// in this case the method will be executed under the same scope of the after method,
// allowing you to access to the configuration object
alert (this.foo);
alert (this.boo);
}