JSFiddle - React, Tailwind, and code Playground

by anazimok

HTML

<button>Send an HTTP GET request to a page and get the result back</button>

JavaScript

$(document).ready(function(){
 $("button").click(function(){

   $.ajax({
        url: "http://ricardohbin.com/cors/testcors.php",
        type: 'GET',
        success: function(content) { console.log("ok"); },
        error: function(XMLHttpRequest, textStatus, errorThrown) {   
            console.log("error: " + errorThrown);
        },
        complete: function() { console.log("complete"); }
     });
  });
});