Raj*_*l 웃 3 javascript jquery jquery-ui jquery-ui-widget
这个和$(this)在像widget这样的widget方法中意味着什么?
例如,拥有这样的小部件,
$.widget("sample.CustomWidget", {
options:{
},
_create: function(){
// Here what do this and $(this) mean
}
});
提前致谢,
-Raja.
它基本上取决于_create方法的调用者......无论如何:
this 指的是函数的"所有者"
$(this) 是将上面的对象包装到jQuery对象中
也可以看看:
http://www.quirksmode.org/js/this.html
http://www.bennadel.com/blog/1838-Wrapping-The-Window-Object-In-A-jQuery-Wrapper.htm
| 归档时间: | 
 | 
| 查看次数: | 248 次 | 
| 最近记录: |