加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Ajax请求中的jQuery Ajax请求

发布时间:2020-12-16 03:15:42 所属栏目:百科 来源:网络整理
导读:是否可能在另一个ajax请求内部发出ajax请求? 因为我需要从第一个ajax请求的一些数据,以进行下一个ajax请求。 首先,我使用Google Maps API获取LAT LNG,之后我使用LAT LNG请求Instagram API(基于搜索的位置)。 再次,这是可能的,如果是如此? $('input#se
是否可能在另一个ajax请求内部发出ajax请求?
因为我需要从第一个ajax请求的一些数据,以进行下一个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!');
    }
});
这里是一个例子:
$.ajax({
        type: "post",url: "ajax/example.php",data: 'page=' + btn_page,success: function (data) {
            var a = data; // This line shows error.
            $.ajax({
                type: "post",url: "example.php",data: 'page=' + a,success: function (data) {

                }
            });
        }
    });

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读