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);
};
è possibile? Grazie, ~ ck a San DiegoPosso cambiare il contesto di javascript "questo"?
Vedere la risposta a questa domanda: http://stackoverflow.com/questions/456967/javascript-how-to-set-this-variable-easily – molf
yepp, più o meno un duplicato di http: // stackoverflow. it/questions/456967/javascript-how-to-set-this-variable-simple La risposta accettata era usare call()/apply(), vedere https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/apply – VolkerK
Questo è solo troppo confuso. Tutte le risposte dicono di no, non puoi farlo. Apparentemente, le risposte alla domanda duplicata sono sì, puoi farlo. Vai a capire. – DOK