JSFiddle - React, Tailwind, and code Playground
HTML
<h1> testpage </h1>
<h2> testing Ajax event triggers</h2>
<p>Ajax call: <a href="#" id="callAjax">Click here to execute Ajax call</a> </p>
<div id="outputAjax">
This text will be replaced with the return content of Ajax call
</div>
JavaScript
$(document).ajaxSend(function() {
alert('trigger ajaxSend');
});
$(document).ajaxStop(function() {
alert('trigger ajaxStop');
});
// document.ready
$(function() {
$('#callAjax').click(function() {
alert('trigger #callAjax.click');
$.get("/echo/html/", "", function(data) {
$('#outputAjax').html(data);
});
});
})