I have some problem using ajax.
How can I assign all result from ajax into outside variable ?
I google it up and found this code..
var return
This is all you need to do:
var myVariable;
$.ajax({
'async': false,
'type': "POST",
'global': false,
'dataType': 'html',
'url': "ajax.php?first",
'data': { 'request': "", 'target': 'arrange_url', 'method': 'method_target' },
'success': function (data) {
myVariable = data;
}
});
NOTE: Use of "async" has been depreciated. See https://xhr.spec.whatwg.org/.