You can bring your code already with a DIV floating above your page.
<div id="loading"> Loading! Please calm down guy... <div>
This DIV can already be displayed in the style of position: absolute , width: 100% and height: 100% . This CSS can be inline, then it will be applied without any other file loading. Or, as @aroth commented, you can simply set its DIV to display: block and the contents of your page in another DIV with display: none .
Then just hide it using simple JavaScript at the end of your code (near </body> ):
<script type="text/javascript"> document.getElementById("loading").style.display = "none"; document.getElementById("content").style.display = "block"; </script>
This script will be executed only after loading all other elements.
Finally, I put this code here as a sample .
source share