I have a function like this that does an ajax call to grab some data from a database.
function db (content) {
$.post('/ajax/db.php', {
operation:operation,
content:content
}, function(data)
{
console.log(data);
return data;
});
}
console.log(data);
gives me the data that I want.
However how do I pass data
to function db so that I can do something like:
var returnedData = db ('content');
Thanks!