I have this kind of JSON object
On client :
var link = {
label: $(’#label’).val(),
address: $(’#address’).val(),
misc: [{cat: selectedCatId},{lang: “FR”},{lang: “EN”}],
submitted: new Date(),
priv: 0,
clicks: 0,
clicked: new Date(),
order: 0,
proprio: “X”
};
Thank you Goatic, this check package is useful but not easy to use.
When I put [Object], I have this error message :
Expected object, got string in field misc[1]
When I put [String], I have this error message :
Expected string, got object in field misc[0]
This will pass properly. I think you should add a console.log(link) just before you call check on the server, to make sure link contains what you think it does.