Parallel JSONP requests in jQuery do not trigger multiple “callback events”?

前端 未结 4 1222
[愿得一人]
[愿得一人] 2020-12-30 13:09

I am experiencing an issue in jQuery when I do multiple jsonp requests, all with the same jsonpCallback function. It seems that only for the one of those the callback functi

4条回答
  •  臣服心动
    2020-12-30 13:16

    Use the success callback instead..

    function userinfo(username){
        $.ajax({
            url: "https://api.github.com/users/" + username,
            success: getName,
            dataType: "jsonp"
        });        
    }
    

提交回复
热议问题