JSFiddle - React, Tailwind, and code Playground
HTML
<input id="go" type="button" value="Go"/>
<div id="timestamp"></div>
JavaScript
$(function(){
$.ajaxSetup({ cache: false });
$('#go').click(performCall);
});
function performCall() {
$('#timestamp').text('Working...');
$.ajax({
url: 'http://fiddle.jshell.net/',
success: callSuccess
});
}
function callSuccess(data, textStatus, jqXHR) {
$('#timestamp').text('Done at ' + new Date());
//This is to exaggerate the effect of the leak
//The leak goes away if the call to $(data) is commented out
for(var x = 0; x < 100; x++) {
$(data);
}
}