JSFiddle - React, Tailwind, and code Playground
HTML
<span id="clickMe_async" >CLICK (Asynchronous)</span>
<br/>
<span id="clickMe_sync" >CLICK (Synchronous)</span>
JavaScript
$('#clickMe_async').click(function(){
$.ajax({
url: document.location.href,
type: 'post',
async: true,
success: function(data, textStatus){
window.open('http://jquery.com/');
//blocked
}
})
});
$('#clickMe_sync').click(function(){
$.ajax({
url: document.location.href,
type: 'post',
async: false,
success: function(data, textStatus){
window.open('http://jquery.com/');
//pass
}
})
});