function myTest()

{

      this.context=this.constructor;

}

 

myTest(); // must be invoke, if not, alert(context)  bug show: context is not defined.

alert(context); //context is window

 

var o =new myTest();

alert(context);  //context is window

alert(o.context);  // context is myTest object

 

相关文章:

  • 2021-08-08
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-02
  • 2021-11-02
  • 2021-09-14
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2021-06-17
相关资源
相似解决方案