PhpRiot
Download Article
Download this article or the entire “Eight Weeks of Prototype” series with all listings and files.




More information
Related Books
JavaScript: The Good Parts

JavaScript: The Good Parts

Most programming languages contain good and bad parts, but JavaScript has more than its share...

jQuery: Novice to Ninja

jQuery: Novice to Ninja

jQuery: Novice to Ninja is a compilation of best-practice jQuery solutions to meet the most...
PhpRiot Newsletter
Your Email Address:

More information

Eight Weeks of Prototype: Week 4, Event Handling in Prototype

Article Comments (4 total)

John Lee, 23 January 2009
Hey, just wanted to say that this series is wonderful... I'm new to Prototype and had a great time reading and understanding your tutorial. Thanks and keep up the great work.

romu31, 27 May 2008
awesome tutoriel . I readed only the 4th lesson .Just a point ( may be u have mentioned it) : the script in the page , in weeks 4 , could mention the onload via "Event.observe(window, 'load', function() { romuLoad() });". anyway , it's the best tuto i read on prototype so far . good work

Pablo Impallari, 24 May 2008

Instead of using: Event.observe(window, 'load', function() { ... your code ... }); You should use: document.observe("dom:loaded", function() { ... your code ... });

Response from PhpRiot:

Thanks Pablo. I did in fact discover this after publishing the first 5 articles (it's not actually clearly documented, just buried in the code). For the sake of consistency I continued to use the window load event but may update all the articles in the future accordingly.


patrov Dimitri, 12 May 2008
What about event-handling on an ajax page?
Submit a Comment
Use the following form to submit a comment for this article. You can include any required code snippets, which we will format and highlight accordingly.


Note: Before your comment appears on PhpRiot, it must be manually approved. The email address field is optional. If you choose to include it, it will be displayed obfuscated to protect it from spammers.

In This Article