I have some problem. When I try post json object, I have error: error: SyntaxError: JSON.parse: unexpected character
My javascript object:
var $arr_data = {
title: '',
category: '',
about: '',
sex: 'unisex',
accessories: 'no',
quantity: []
};
I think that a problem are in this function:
function data_quantity($size_input,$quant_input)
{
var $string = "{color:'"+$pattern+"',size:'"+$size_input+"',quantity:'"+$quant_input+"'}";
$arr_data.quantity.push($string);
}
alert(JSON.stringify($arr_data)); returns the following string:
{
"title":"title_test",
"category":"3",
"about":"about_test",
"sex":"woman",
"accessories":"no",
"quantity":[
"{color:'none',size:'xxl',quantity:'5'}",
"{color:'black',size:'xxl',quantity:'1'}",
"{color:'white',size:'s',quantity:'9'}"
]
}
$patterncame from (indata_quantityfunction)?