display div while load

<script>
  $(window).load(function() {
    $('#loading').hide();
  });
</script>