Note $thisname and $thisvalue. I want $thisname to be the key/name and value assigned to it will be $thisvalue. As it currently is the name/value pair is invalid unless I replace $thisname with some static value which is not a variable.
function SaveNews($thisname, $thisvalue, $thispageid) {
$.post('/Admin/SaveNews',
{ $thisname: $thisvalue, PageID: $thispageid },
function (data) {
});
}
You cannot do that with JavaScript object literal syntax. You can, however, construct the object you need.