JavaScript event window.onload not triggered

Posted by Bernhard V on Stack Overflow See other posts from Stack Overflow or by Bernhard V
Published on 2010-05-11T12:56:09Z Indexed on 2010/05/11 13:04 UTC
Read the original article Hit count: 253

Filed under:
|
|

Hi!

I've got the following code in a website:

 window.onload = resize;
 window.onresize = resize;

 function resize(){
  heightWithoutHeader = (window.innerHeight - 85) + "px"; 
  document.getElementById("haupttabelle").style.height = heightWithoutHeader;
  document.getElementById("navBar").style.height = heightWithoutHeader;
 }

The onresize works fine, but the onload event never fires. I've tried it in Firefox and Chrome and neither of them works.

Thank you for your help and go for the reputation! ;D

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about onload