dar*_*uby 0 javascript jquery jquery-ui
调用基类方法对我来说似乎不起作用.我有以下设置:
...
<div class='my'></div>
...
Run Code Online (Sandbox Code Playgroud)
和Javascript
$.widget('tt.name1',{
_create: function() {
this.name = 'name'
console.log('-->', this.name);
}
});
$.widget('tt.name2',$.tt.name1, {
_create: function() {
this._super();
/*$.tt.name1.prototype._create.call(this);*/
this.name = 'name2'
console.log('-->', this.name);
}
});
$('.my').name1();
$('.my').name2();
Run Code Online (Sandbox Code Playgroud)
调用时会产生以下输出和错误 this._super()
- > name
Uncaught TypeError:Object#没有方法'_super'
| 归档时间: |
|
| 查看次数: |
2517 次 |
| 最近记录: |