On every page, call a <div> element to show the loading thing.... then when the page is finally rendered, go ahead and send another call to that same function that shows the function, and hide it.
function showLoading(state) {
if (state == true) {
document.getElementById('loader').style.visibility = visible;
}
else {
document.getElementById('loader').style.visiblity = hidden;
}
}
window.onload = function() {
showLoading(true);
/* Do some other stuff in here... the long part... */
showLoading(false);
}
Of course, that's a very simplifed answer.... and it works cross-browser/platform since it's a w3c style code....