摘要: 在学习js时,应该先了解下this关键字,关于js中的this关键字和其他的面向对象语言中的this是不同的,比如在java中,this指的的是当前对象,而在js中,w3c是这样规定的:关键字 thisthis 的功能在 ECMAScript 中,要掌握的最重要的概念之一是关键字 this 的用法,它用在对象的方法中。关键字 this 总是指向调用该方法的对象,例如:var oCar = new Object;oCar.color = "red";oCar.showColor = function() { alert(this.color);};oCar.showColor 阅读全文
posted @ 2014-03-19 12:13 斯拉克 阅读(291) 评论(0) 推荐(0) 编辑