简体   繁体   中英

Retrieving a Json array from the URL by making a request using jQuery.ajax()

提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供   中文简体   中文繁体   中英对照 版本,有任何建议请联系yoyou2525@163.com。

$.ajax({
    url: 'https://s3.ap-northeast-2.amazonaws.com/cs374-csv/country_capital_pairs.csv',
    type :"GET",
    dataType:"json",
    success: function(response){
        if(response.success){
            var window = response.pairs;
        }
        else{
            alert("Errors");
        }
    }
});

I'm trying to retrieve a Json array from the URL by making a request using jQuery.ajax. My output is displayed like this:

window.pairs
(171) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, 

But, the expect output should be like the photo here, Expect Output . How can I fix it?

No answers.You can refer to the related questions on the right.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

Related Question
 
粤ICP备18138465号  © 2020-2022 STACKOOM.COM