JSFiddle - React, Tailwind, and code Playground

by justinwyllie

JavaScript

//testing how aborting an ajax call calls the error handler
$(function() {
    
    alert("hello");
   
    var xhr = $.ajax({
        type: "post",
        url: "/echo/json",
        error: function(){alert("I've been aborted")},
        success: function(){alert("I've succeeded")}    
    });
    
  
    
    xhr.abort();

    
});