I have AJAX request and want to do my code after i get response. For it i try callback function:
AJAX
function some_function(callback) {
var mydateArray=[];
Ext.Ajax.request({
method: "POST",
url: url_servlet+"/dateIntensityJson.jsp",
success: function(response){
jsonObject = JSON.parse(response.responseText);
mydateArray = jsonObject.data;
}
});
callback(mydateArray);
}
My function:
function intWinCreate(dateArray){
...some code...
}
calling functions:
some_function(intWinCreate(dateArray));
And i get error:
ReferenceError: dateArray is not defined
I do callback wrong? And i DONT USE jQuery.