slpctrl Posted May 28, 2008 Share Posted May 28, 2008 Dumb question I know, but alright I have a javascript function, how do I call the function when the page loads? Quote Link to comment Share on other sites More sharing options...
haku Posted May 28, 2008 Share Posted May 28, 2008 Add this to the end of your javascript: window.onload = function() { // add any code you want to execute on page load. You can add as much as you would like in between the curly braces } Quote Link to comment Share on other sites More sharing options...
calabiyau Posted May 28, 2008 Share Posted May 28, 2008 or.... <body onload="function_name();"> Quote Link to comment Share on other sites More sharing options...
haku Posted May 29, 2008 Share Posted May 29, 2008 That method is outdated. 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.