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);   
};

is this possible? Thanks, ~ck in San Diego

这可能吗?谢谢,〜在圣地亚哥

3 个解决方案

#1


No, it's not possible.

不,这是不可能的。

You can call a method with a specified value for this (using method.apply()/method.call()) but you cannot re-assign the keyword, this.

您可以为此调用具有指定值的方法(使用method.apply()/ method.call()),但不能重新分配关键字。

更多相关文章

  1. 为什么分配给True / False不能像我期望的那样工作?
  2. numpy无法将值分配给列的一部分
  3. 深入理解Java虚拟机读书笔记---垃圾回收与内存分配
  4. java基础---JVM---调优,垃圾收集器,内存分配策略

随机推荐

  1. android中选中,获得焦点的,点击区别
  2. Android(安卓)和风天气SDK获取天气
  3. 2010.10.28———Android 02
  4. 【Android】FadingEdge
  5. 解读Android(安卓)3.2的新特性
  6. AndroidManifest.xml中一些权限配置
  7. Android NDK应用开发
  8. android和Myeclipse搭建环境
  9. 安卓设置文字自动滚动
  10. Cordova 3.x 源码分析(6) -- cordova.js本