Make cross-domain ajax JSONP request with jQuery

前端 未结 7 2125
鱼传尺愫
鱼传尺愫 2020-11-22 04:10

I would like to parse JSON array data with jquery ajax with the following code:



        
7条回答
  •  Happy的楠姐
    2020-11-22 04:38

    You need to use the ajax-cross-origin plugin: http://www.ajax-cross-origin.com/

    Just add the option crossOrigin: true

    $.ajax({
        crossOrigin: true,
        url: url,
        success: function(data) {
            console.log(data);
        }
    });
    

提交回复
热议问题