This is what I have:
function populateElement(arg1) {
getData(arg1);
}
function getData(query) {
var url = "http://foo" + query + "&callback=processData";
// do stuff
}
function processData(results) {
callbackForGetData(results);
}
function callbackForGetData(result) {
// process data
}
I want to pass two more arguments to function populateElement like so:
function populateElement(arg1, arg2, arg3) {
getData(arg1);
}
And have the arg2, arg3 available in callbackForGetData
function callbackForGetData(result) {
// process data
// use arg2, arg3 here
}
How should I do this?
callbackForGetDatais being called as a JSONP callback so the OP doesn't have any control over how it is called.