I would like to create a dynamic JSON array in Javascript like that :
var jsonData = {
"Tasks" : [
{
"__metadata" : {
"uri" : "...",
"type" : "..."
},
"ID" : "...",
"Category" : "..",
// ...
},
{
"__metadata" : {
"uri" : "...",
"type" : "..."
},
"ID" : "...",
"Category" : "..",
// ...
},
// others tasks
], "__count" : "2"
};
I found how to create a JSON in Javascript but not with this syntax. So what is the good way to create the JSON object with the 'Tasks' array and add items in it ?
Thank you for your help
__countattribute is redundant. It is already stored within theTasksarray.