Quick question:
How can I replace data
by a variable?
$.getJSON('getdata.php', {data: 'hello'}, function(jsonResult) {
Just to be clear, i do not mean 'hello'
Quick question:
How can I replace data
by a variable?
$.getJSON('getdata.php', {data: 'hello'}, function(jsonResult) {
Just to be clear, i do not mean 'hello'
You can do that by using the following:
var myData = {};
var keyName = 'example';
myData[keyName] = 'hello';
$.getJSON('getdata.php', myData, function(jsonResult) {