Google uses AJAX queries on GMail, you can do the same with jQuery. If you want to replace all the code on the page.
function preload(url2load,anyDataIfAny) { $.ajax({ type: 'POST', url: url2load, data: anyDataIfAny, success: function(data) { $(html).html(data); } }); }
This will show the user the loading screen until the page is loaded, and then replace the loading screen with a code request.
source share