JSFiddle - React, Tailwind, and code Playground

by hslincoln

HTML

<div id="result"></div>

JavaScript

$(document).ready(function() {
    $.ajax({
    type: "GET",
    url: "http://webmedia.jmlgroup.co.uk/itv/js/the-store.json?callback=functionCall",          
    contentType: "application/json; charset=utf-8",
    crossDomain: true,
    dataType: "jsonp",
    data: "{}",
    Accept: "",
    beforeSend: setHeader,
    success: GetAlltheITVStuff,
    error: GetALLtheITVStuffError,                
    });
});

function functionCall(json)
{alert(json);}

function setHeader(req) {
    req.setRequestHeader("Authentication", "Basic credentials");
    req.setRequestHeader("Content-Type", "application/json");
    req.setRequestHeader("Accept", "application/json");
}    

function OnGetAllMembersSuccess(data, status) {
    alert(status);
    $.each(data.result, function(key, value) {              
        $("#result").append(key+" : "+value);
        $("#result").append("<br />");
    });
}

function GetALLtheITVStuffError(request, status, error) {
    alert(status);
}