JSFiddle - React, Tailwind, and code Playground

by Daniel Lamb

HTML

<button id="example">Get</button>

JavaScript

$('#example').click(function() {
  $.get('/echo/json/',
    // data to send on the query string
    { foo: 'bar' }
  )
  .done(function(data) {
    console.log('success', data);
  })
  .fail(function() {
    console.log('fail');
  })
  .always(function() {
    console.log('always');
  });
});