> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/ > libs/prototype/1.6.0.3/prototype.js"></script> > <script type="text/javascript"> > Event.observe(window, 'load', function() { > > }); > > </script> > </body>
Why? Why not include prototype and other things in the head section of the page? If you use observe it on window load it doesn't haveto byat the end of the page. Bythe way, you can also use dom:loaded instead of window load :) ------------------------------------------------------ >From API Docs (http://prototypejs.org/api/event/observe) : "Of course, you'd want this line of code to run once the form exists in the DOM; but putting inline scripts in the document is pretty obtrusive, so instead we'll go for a simple approach that waits till the page is fully loaded: Event.observe(window, 'load', function() { Event.observe('signinForm', 'submit', checkForm); }); Just a little wrapping… Note that if your page is heavy, you might want to run this code before the page is fully loaded: just wait until the DOM is loaded, that will be enough. (Prototype's dom:loaded event can help you with that.)" ------------------------------------------------------ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---
