You need to sign in to do that
Don't have an account?
dkraun
running javascript when the body is done loading
I am wondering if there is a way to simulate the functionality of <body onload=''> in a visualforce page. I have tried setting window.onload to my javascript function, but this gets called before the page actually loads. It seems like this is due to multiple documents being present in a visualforce page. I also tried turning off development mode to remove the additional iframe, but there are still multiple documents in the page. Any ideas?
Mike
Ext.js provdes Ext.onReady()
onReady(
Function fn
,Object scope
,boolean override
) : voidThe method the event invokes An object that becomes the scope of the handler If true, the obj passed in becomes
the execution scope of the listener
Returns:fn
: Functionscope
: Objectoverride
: booleanvoid
Dojo provides dojo.addOnLoad()
The lightest weight toolkit of all is most likely Prototype.js and it provides:
If you want just the basic functionality without pulling in an entire library then take a look at this arcticle. All of these libraries basically make use of closures /or event listeners etc.
Message Edited by dchasman on 07-11-2008 10:34 AM