gpt4 book ai didi

javascript - 未捕获的异常错误 "Illegal operation on WrappedNative prototype object"

转载 作者:行者123 更新时间:2023-12-01 01:54:35 25 4
gpt4 key购买 nike

是否知道为什么以下 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com