function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Arun_PaliArun_Pali 

showHeader="true" .. urgent help folks !!

Hi Folks,
I am facing an issue. In my Visualforce page, if I specify showHeader="true" and also have a JS function called on the body onload event, the function is not getting invoked.

But it works the otherway when I set the showHeader="false".


Any hints would be helpful,
A B
jwetzlerjwetzler
the body tag is only supported when you have showHeader="false", at which point you can go ahead and use your own <html>, <head> and <body> tags.  If you want to use the salesforce header those tags all get generated for you (notice that if you try to use a <body> or <head> tag with the header on and you view source, you'll get duplicate body or head tags).

So unfortunately right now the only way to specify something on body onload is to take over the page entirely, removing the header.  If you'd like to have a way to append to these functions please create an idea on the idea exchange so we can prioritize it.
Arun_PaliArun_Pali
Hi jwetzler,
Thanks a lot for the hints .. I completely see what you say ... I think now I am in a scary situation :-( ....
Ron HessRon Hess
here is a discussion about onload that may help you

http://haacked.com/archive/2006/04/06/StopTheWindow.OnloadMadness.aspx

you can chain your onload with the one on the page using the method described.