JSFiddle - React, Tailwind, and code Playground
HTML
<div id="text"></div>
JavaScript
function api_get () {
$('#text').append('<p>Ajax start</p>');
$.ajax({
type: "GET",
url: '',
crossDomain: true,
dataType: 'json',
data: {},
async: false,
timeout: 10000,
success: function (data) {
$('#text').append('<p>Ajax success</p>');
console.warn(data);
}
});
};
$('#text').append('<p>Before ajax</p>');
api_get();