I want to use a variable in jQuery.ajax {data {action}
I get this Error:
SyntaxError: missing : after property id
if I replace "+id+" with "61" its working perfect.
var id = 61;
jQuery.ajax({
method: "POST",
url: "/?someurl",
data: {
table: "__databasename",
action: "edit",
"data["+id+"][persons]": value
}
})
.done(function(msg) {
alert("Data Saved: " + msg);
});