Parallel Ajax Calls in Javascript/jQuery

前端 未结 9 2148
甜味超标
甜味超标 2021-02-07 17:26

I am completely new to Javascript/jquery world and need some help. Right now, I am writing one html page where I have to make 5 different Ajax calls to get the data to plot grap

9条回答
  •  春和景丽
    2021-02-07 17:52

    In jQuery.ajax you should provide a callback method as below:

    j.ajax({
            url : url0,
            async : true,
            dataType : 'json',
            success:function(data){
                 console.log(data);
            }
        }
    

    or you can directly use

    jQuery.getJSON(url0, function(data){
      console.log(data);
    });
    

    reference

提交回复
热议问题