Error uncaught exception "Invalid operation on WrappedNative prototype object"

Is there any idea why the following javascript / jquery code might throw an error message: uncaught exception: [Exception ... "Illegal operation on a wrapped Native object prototype"]?

the code:

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');   
                             }
                          }
                       });
    }
+3
source share
1 answer

You violate the basic principles of OOP here: you separate the method from its object.

-1
source

Source: https://habr.com/ru/post/1787686/


All Articles