I'm having a problem developing a script based on a user-data API.
I have created a function getUserData(username, what);
and what it does is this;
var lasuniAPI = "script/data.php";
$.getJSON(lasuniAPI, { p: 'userdata', data: username}, function(data){
return data.userdata.what;
});
I want 'what' to be defined but sadly I'm getting undefined returns.