Hi I need to store an AJAX Response into two variables x and y or into a array. My AJAX response is a array. I am able to see the data but only with and alert into che call. I n
you can store the ajax response in a global array for further use in other javascript function
var ajaxResult=[];
$(document).ready(function(){
$.ajax({
url: 'ajaxload.php',
async:true,
dataType: "json",
success: function(data)
{
ajaxResult.push(data);
}
});
});
otherJsfunc()
{
console.log(ajaxResult);
}