首页 > 编程语言 > 详细

javascript this的意思

时间:2015-10-26 13:28:28      阅读:179      评论:0      收藏:0      [点我收藏+]

his指向哪里?

一般而言,在Javascript中,this指向函数执行时的当前对象。

In JavaScript, as in most object-oriented programming languages, this is a special keyword that is used within methods to refer to the object on which a method is being invoked.

——jQuery Fundamentals (Chapter 2), by Rebecca Murphey

值得注意,该关键字在Javascript中和执行环境,而非声明环境有关。

The this keyword is relative to the execution context, not the declaration context.

 

可参考下面这个文章

 

http://www.cnblogs.com/justany/archive/2012/11/01/the_keyword_this_in_javascript.html

javascript this的意思

原文:http://www.cnblogs.com/terryc/p/4910832.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!