JSFiddle - React, Tailwind, and code Playground

HTML

<button>Send post</button>

JavaScript

$("button").click(function(){
    $.post("/test6.php", {"arg1": "1", "arg2": "2"}, function(response) {
      alert('Got this from the server: ' + response);
    }).done(function() {
      alert( "second success" );
    }).fail(function(xhr, textStatus, errorThrown) {
      alert( textStatus+" - "+errorThrown );
    });
  });