直接定義變量就行了
$.ajax({
url: 'index1.json',
cache: false,
type: 'post',
data: data,
dataType: 'json',
async:false,
success:function(res){
data_res = res;
//console.log(data_res);
}
});
console.log(data_res);
直接定義變量就行了
$.ajax({
url: 'index1.json',
cache: false,
type: 'post',
data: data,
dataType: 'json',
async:false,
success:function(res){
data_res = res;
//console.log(data_res);
}
});
console.log(data_res);