How to retrieve data from Wikipedia API using JSON?

后端 未结 3 418
长情又很酷
长情又很酷 2020-12-10 18:00

Here I am fetching the data from Wikipedia using following code. but it is not working for me.

var playListURL = \'http://en.wikipedia.org/w/api.php?format=j         


        
3条回答
  •  轮回少年
    2020-12-10 18:38

    Use the following code to get the data:

    $.getJSON(playListURL ,function(data) {
            $.each(data.query.pages, function(i, item) {
                alert(item.title);
    
            });
        });
    

提交回复
热议问题