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

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -