[Solved] Is there a way to get the main paragraph from Wikipedia using JavaScript only? [closed]


To avoid cross-domain issues, you can do this using JSONP:

$.getJSON("http://en.wikipedia.org/w/api.php?action=query&prop=extracts&exintro&format=json&callback=?&titles=Google", function(data){
    var page = data.query.pages;
    var intro = "";
    for (var key in page) {
        var obj = page[key];
        intro = obj.extract;
    }
    console.log(intro);
});

1

solved Is there a way to get the main paragraph from Wikipedia using JavaScript only? [closed]