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
devendra dhakadevendra dhaka 

onLoad event of BODY tag

<apex:page showHeader="false" sidebar="false" >

 

When I put showHeader and sidebar = True

 

onLoad of BODY tag stopped working, otherwise it's working fine.

 

Why is this happening ??

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

I wrote up a blog post about this with one way to workaround it:

 

http://bobbuzzard.blogspot.co.uk/2011/05/onload-handling.html

All Answers

sfdcfoxsfdcfox

The standard headers include JavaScript code for a "popup window" that warns user of session expiry. This is probaby conflicting with your own onLoad event (the body.onLoad in this case is used to start the timer, etc). Try using the W3C method (addEventListener) and/or the Microsoft model (attachEvent) to attach the event so it will be called correctly.

bob_buzzardbob_buzzard

I wrote up a blog post about this with one way to workaround it:

 

http://bobbuzzard.blogspot.co.uk/2011/05/onload-handling.html

This was selected as the best answer