是否有可能在另一個Ajax請求中發出ajax請求? ,因爲我需要第一個ajax請求中的一些數據來發出下一個ajax請求。Ajax請求中的jQuery Ajax請求
首先,我使用Google Maps API獲取LAT & LNG,之後我使用該LAT & LNG請求Instagram API(基於搜索的位置)。
再一次,這是可能的,如果是的話如何?
$('input#search').click(function(e){
e.preventDefault();
var source=$('select[name=state] option:selected').text()+' '+$('select[name=city] option:selected').text()+' '+$('select[name=area] option:selected').text();
var source=source.replace(/ /g, '+');
if(working==false){
working=true;
$(this).replaceWith('<span id="big_loading"></span>');
$.ajax({
type:'POST',
url:'/killtime_local/ajax/location/maps.json',
dataType:'json',
cache: false,
data:'via=ajax&address='+source,
success:function(results){
// this is where i get the latlng
}
});
} else {
alert('please, be patient!');
}
});
是其可能 – Ved 2012-04-10 13:12:06
你可以發佈你到目前爲止的代碼。 – 2012-04-10 13:15:04
我編輯了我的問題,代碼高於 – 2012-04-10 13:20:01