JSFiddle - React, Tailwind, and code Playground

by Sean Macdonald

HTML

<div id="output">
</div>

CSS

#output {
    border: 2px dotted gray;
    background-color: #DEF;
    width: 500px;
    height: 250px;
}

JavaScript

"use strict";

var wiki_url = 'http://en.wikipedia.org/w/api.php';

$.ajax({
    url: wiki_url,
    crossDomain: true,
    dataType: 'jsonp',
    data: {
        format: "json",
        action: "parse",
        page: "Bay_View_Historical_Society"
    },
    error: function(xhr,status,error){
        alert( error );
    }
}).done(function(rawhtml){
    var dom_object = $( '<div>' + rawhtml.parse.text['*'] + '</div>' );
    var p = $(dom_object).find('p').first();
    console.log(p);
    p.appendTo('#output');
});