# Does the "onBeforeLoad" event exist?

**URL:** https://forum.kirupa.com/t/does-the-onbeforeload-event-exist/297298
**Category:** Uncategorized
**Created:** [September 29, 2009, 9:22pm UTC](https://forum.kirupa.com/t/does-the-onbeforeload-event-exist/297298 "2009-09-29T21:22:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![NeoDreamer](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@NeoDreamer](https://forum.kirupa.com/u/NeoDreamer)
#### Post date: [September 29, 2009, 9:22pm UTC](https://forum.kirupa.com/t/does-the-onbeforeload-event-exist/297298/1 "2009-09-29T21:22:41Z")

</div>

I have this huge Javascript GUI that takes like 10 seconds to boot up. I would like to not let the user see the DOM getting hacked to pieces as it’s loading. So I was wondering how to do an “onBeforeLoad” event like Gmail:

![](http://forum.kirupa.com/uploads/kirupa/5858/041d7de40bcd8eb3.png)

Basically, I’d want a Preloader object to be run right off the bat and I’ll have all my large JS files ping it at different points of the initialization:

```php

// move loading bar up 10%
MYAPP.preloader.increase(.10);

```

So how do I instantiate my Preloader object before the body loads?
