是否有可能在另一个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