是否知道为什么以下 javascript/jquery 代码可能会产生错误消息: 未捕获的异常:[异常...“对 WrappedNative 原型(prototype)对象进行非法操作”]?
代码:
function deletereceipt(id){
var $delconfdialog = $('<div id="dialog-confirm"></div')
.html('Are you sure you want to delete this receipt?')
.dialog({
autoOpen: true,
title: 'Delete Confirmation',
buttons: {
"Delete": function(){
$.post('Receipt.py',{'cm':'Delete','receiptid': obj},function(){
$('#receiptrow'+id).remove();
});
$(this).dialog('close');
},
"Cancel" :function(){
$(this).dialog('close');
}
}
});
}
最佳答案
您在这里违反了基本的 OOP 原则:您将方法与其分离 对象。
关于javascript - 未捕获的异常错误 "Illegal operation on WrappedNative prototype object",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4794082/