0

enter image description here

I have a visualforce page with showheader set to true. But I see the page rendering with the tabs in header not wrapping

4
  • Are you using jquery document event in page Commented Jun 9, 2016 at 17:26
  • @Tushar Sharma No I am not using jQuery . Though I have standard JS window.onload = function() {} Commented Jun 9, 2016 at 17:30
  • Using window.onload will break the standard onload function. Use window.addEventListener instead.
    – sfdcfox
    Commented Jun 9, 2016 at 17:31
  • Good to know. Thanks sfdcfox and Tushar Sharma for quick turnaround Commented Jun 9, 2016 at 17:40

1 Answer 1

4

When you use this structure, you overwrite any existing listeners:

window.onload = function () { }

Instead, look at best way of unobtrusive onload in plain javascript:

document.addEventListener("DOMContentLoaded", new function (){}, false);
5
  • There's really no need to mention attachEvent, as no browser that salesforce supports supports attachEvent, and not addEventListener...
    – sfdcfox
    Commented Jun 9, 2016 at 17:36
  • Ah didn't realize it doesn't apply to 9+. @sfdcfox
    – Adrian Larson
    Commented Jun 9, 2016 at 17:37
  • @Adrian Larson That solves the issue. Commented Jun 9, 2016 at 17:40
  • @AdrianLarson We are finally out of the stone ages of browsing... and it only took a decade or so.
    – sfdcfox
    Commented Jun 9, 2016 at 17:42
  • I was so excited when they finally dropped support for IE versions that should have been axed so many years sooner. At least it's done.
    – Adrian Larson
    Commented Jun 9, 2016 at 17:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .