0
我已經bulid一個js類,它是有控制(HTML控件)參數,我嘗試dinamicly onchange事件添加到控件,但我有如下因素的錯誤:JS錯誤:HTMLFILE:未實現
HTMLFILE:未實現
//-------------- the code
Contrl.prototype.AddChangeEvent = function() {
var element = this.docID;
var fn = function onChange(element) {
// action
};
if (this.tag == "input" && (this.el.type == "radio")) {
this.el.onclick = fn(element); // there i have the error
}
else {
this.el.onchange = fn(element); // there i have the error
}
}
不僅打電話,但結合this.el.onclick – user368038 2010-06-22 15:04:36
@haroldis:不,你不是綁定它。你正在試圖綁定它,但你沒有成功。 – SLaks 2010-06-22 15:07:23