对不起,我的英语。下面是示例代码:如何访问jQuery事件函数中的对象属性
/**
* @constructor
*/
function MyNewClass(){
this.$my_new_button = $('<button>Button</button>');
this.my_value = 5;
this.init = function(){
$('body').append(this.$my_new_button);
this.$my_new_button.click(
function(){
// Its always alerts "undefined"
alert(this.my_value);
}
)
}
}
如何访问对象中的jQuery my_value
物业单击事件函数? 这可能吗?