I call an external .js file into my HTML pages.Now i want to load a function (from that external file) when the body load.What should i do. Example: <body onload="what should i write here to load the function of external js file?"> As i now the external js is call as: <script type="text/javascript" src="" ></script> or what other thing you suggest me? Regards
Just call the function like you would any other, using its name: <body onload="myFunction();"> Code (markup): alternatively, you can add this event handler from the source of your script: function loadHandler() { //Do whatever you need to do here... } [B]window.onload = loadHandler;[/B] Code (markup):