I have 2 functions with ajax call. How can i use the variables in function2 that return in function1.
function func1 (){
$.ajax({
url:"",
dataType: 'json',
success: function(data){
var foo
}
});
//How can i use var foo in func2(foo)?
//i try .done(func2(foo)); but it returns foo is not define
}
function func2 (param){
$.ajax({
url:"",
dataType: 'json',
success: function(data){
}
});
}