Calling .load() is just a convenient shorthand. You can set global ajax parameters before calling .load() . If this is not viable, you will have to use the lower level API . In any case, you need the timeout ajax option:
$.ajax('http://site.com/script.php', { data: postData, timeout: 1000, // 1000 ms success: function (data) { $('#ele').html(data); toggleModalLoading(); } });
source share