I am trying to pass a function to another function to use in its call back, I call the function using...
call("login", {email:user,password:pw}, alert(getResponse()));
call is defined as:
function call(url, p, f){
$.getJSON(baseUrl + url, p, f(data));
};
and getResponse is defined as:
function getResponse(d){
return d.result.success;
};
data is returned by getJSON (see here: http://api.jquery.com/jQuery.getJSON/)
How am I meant to pass data to that function?
The function is called, because it hits a break point I set.
When getResponse is called though I get Uncaught ReferenceError: data is not defined