I have the below code, which works perfectly to automatically update the page. However, during the initial page load it takes 40 seconds before the fetched content appears on the page. How can I make the content appear immediately during the initial load then update after 40 seconds?
$(document).ready(function(){
jQuery(window).on("load", function(){
refreshInterval = setInterval(function(){
$('#box').load('handle.php');
},40000);
});
});