I made a query to an API using Ajax but I wasn't able to use the results outside of the ajax constructs.
It is always telling me xx is undefined.
The issue is to be able to use the xx variable outside that ajax constructs.
Please, how do I achieve that?
$.ajax({
type: "GET",
url: url,
dataType : "json",
success: function(data){
var xx = (data.results[0].formatted_address);
}
})