javascript - After sending the data to the server, I get the message 'Uncaught TypeError: Illegal invocation' -


i have problem sending ajax request in php-script.

my jquery script selects fields form , sends arguments jquery function. but! after sending data server, message 'uncaught typeerror: illegal invocation'.

example ajax

... this.createorderbykey = function(optionsdata, customerdata) {     $.ajax({         url: 'index.php?route=module/pd_quick_order/createorderbykey',         type: 'post',         data: {options: optionsdata, customer: customerdata},         async: false,         success: function(order) {             console.log(order);         }     }); }; ... 

example optionsdata variable

var productoptions = $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'); 

console.log(optionsdata)

0: input.quantity 1: input context: document length: 2 prevobject: v.fn.v.init[1] selector: ".product-info input[type='text'], .product-info input[type='hidden'], .product-info input[type='radio']:checked, .product-info input[type='checkbox']:checked, .product-info select, .product-info textarea" __proto__: v[0] 

console.log(customerdata)

object {name: "max", phone: "+7 (988) 014-07-77"} 

for fiddle, theissue in data: {productionoptions} said.

the use of curly braces here causes error because not providing object key value pairs -with use of {..} creating sort of statement block, leading not invokable error. why when remove {}, works.

as original snippet in question, don't see why wouldn't work based on above reasoning - there problem when use such?


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -