码迷,mamicode.com
首页 > 编程语言 > 详细

javascript this的意思

时间:2015-10-26 13:28:44      阅读:177      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!