JSFiddle - React, Tailwind, and code Playground
JavaScript
alert("*");
$.getJSON("https://localhost:44300/api/trivia", function(data) {
alert(JSON.stringify(data));
})
.done(function() { alert('getJSON request succeeded!'); })
.fail(function(jqXHR, textStatus, errorThrown) {
alert('getJSON request failed! ' + textStatus + ' :: ' + jqXHR + ' :: ' + errorThrown);
$.each(jqXHR, function(k, v) {
//display the key and value pair
alert(k + ' is ' + v);
});
})
.always(function() { alert('getJSON request ended!'); });