Email conversation
From | William Wedler |
To | Me |
Subject | initializing page before window.onload event fires |
Date | 4 January 2006 20:33 |
Do you know of a good way to initialize a page before the
window.onloadevent fires? By initialize I am referring to calling a
function, init(),
that could put focus on a form text input or operate on some other part of
the DOM (like change style properties). If I use the window.onload action
listener, then init() does not get called until everything in the page,
including images and iframes, are loaded. Do you have any suggestions that
would call init() faster? I am trying to keep all of the javascript in the
head and in an externally linked .js file if possible.
Thanks,
William
From | Me |
To | William Wedler |
Subject | Re: initializing page before window.onload event fires |
Date | 4 January 2006 21:26 |
William,
> Do you know of a good way to initialize a page before the
> window.onloadevent fires? By initialize I am referring to calling a
> function, init(),
put this before the </body> tag:
<script type="text/javascript">
init();
</script>
That will run as soon as the page has loaded, without waiting for images or
iframes.
Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/