jackpf Posted April 22, 2009 Share Posted April 22, 2009 Good evening, I am trying to impliment a javascript window.onload handler, as it would be useful to be allowed to call window.onload multiple times. It's pretty simple: function load(f) { window.onload += function() { f; } } But when I add a function with a document.getElementById() or something referencing the DOM tree, it seems to lose value. I get a javascript error saying the element is undefined, when it isn't. Just wondering if anyone knows why this is. Thanks, Jack. Quote Link to comment Share on other sites More sharing options...
jackpf Posted April 22, 2009 Author Share Posted April 22, 2009 How stupid of me - I wasn't using quotes on the function when calling it. *slaps self in face* Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.