JSFiddle - React, Tailwind, and code Playground

by LMDavid

HTML

<div id="status"></div>

JavaScript

var API_STATUS_URL = "http://gw2stats.net/api/status.json";
var YQLQuery = encodeURIComponent("select * from json where url=\"" + API_STATUS_URL + "\"");
var YQLUrl = 
    "http://query.yahooapis.com/v1/public/yql?" +
    "q=" + YQLQuery +
    "&format=" + "json";
$.ajax({
    url: YQLUrl,
    dataType: "jsonp",
    timeout: 10000
})
.done(function(data) {
    var results = data.query.results;
    if (results != null) {
        $.each(results.api, function(key, data) {
            $("#status").append(key + " => " + data.status + "<br/>");
        });
    }
    else {
        $("#status").append("API status server is DOWN!<br/>");
    }
})
.fail(function(jqXHR, textStatus, errorThrown) {
    $("#status").append("Error retrieving API status information!<br/>");
});