var UI$Contract$ddlForm_change = function() {
//'this' is currently the drop down that fires the event
// My question is can I change the context so "this" represents another object?
this = SomeObject;
// then call methods on the new "this"
this.someMethod(someParam);
};
¿Esto es posible? Gracias, ~ ck en San Diego¿Puedo cambiar el contexto de javascript "this"?
Ver la respuesta a esta pregunta: http://stackoverflow.com/questions/456967/javascript-how-to-set-this-variable- fácil – molf
yepp, más o menos un duplicado de http: // stackoverflow. com/questions/456967/javascript-how-to-set-this-variable-easily La respuesta aceptada fue usar call()/apply(), ver https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/apply – VolkerK
Esto es TAN confuso. Todas las respuestas dicen que no, no puedes hacerlo. Aparentemente, las respuestas a la pregunta duplicada sí, puedes hacerlo. Imagínate. – DOK