Tôi có một vấn đề, tôi muốn tạo ra một lớp JavaScript:Lớp trong JavaScript sử dụng nguyên mẫu
function Calculatore(txt,elements) {
this.p= new Processor();
this.output=txt;
$(elements).click(this.clickHandler);
}
Calculatore.prototype.clickHandler = function() {
var element=$(this);
// Code Here
// "this" contains the element.
// But what if I want to get the "output" var?
// I tried with Calculatore.prototype.output but no luck.
}
Vì vậy, làm thế nào tôi có thể giải quyết này?
oh, bạn đã lưu tóc của mình, cảm ơn! – elios264