, . JavaScript , vars.
/usercontrol , , . , , , .
Instead of punching a duck until it does what you want, why not create a common extension method? Using our case, here is an example:
GlobalNameSpace.ExtensionFunction = function(oParam1, oParam2, oParam3)
{
return;
}
GlobalNameSpace.Control.ControlFunction(oSender, oArgs)
{
GlobalNameSpace.ExtensionFunction(oSender, oArgs);
}
GlobalNameSpace.Page.Init
{
GlobalNameSpace.ExtensionFunction = function(oSender, oArgs)
{
GlobalNameSpace.Page.Function(oSender, oArgs);
}
}
The short jump to this method is that you want to do this for several objects at a time, and at this point it might be better to move the extension method to the code that you specifically want to extend. This will make the extension code less general, but it can be solved according to your needs.
source
share