|
Helping ordinary people create extraordinary websites! |
Top 10 Custom JavaScript Functions Of All TimeBy Dustin Diaz2006-08-22
9) addLoadEvent() Originally written by Simon Willison and highly adopted by many others as a simple way to add events to trigger after the page has loaded. This of course attaches all your events to the onload event handler which some still see as necessary, nevertheless it does exactly what it’s supposed to, and does it well. addLoadEvent() by Simon WillisonOf course another method is to simply assign multiple event listeners to the window by using addEvent() as described in number 10 as follows: assigning multiple load events to window
Tutorial Pages: » Top 10 custom JavaScript functions of all time » 10) addEvent() » 9) addLoadEvent() » 8) getElementsByClass() » 7) cssQuery() » 6) toggle() » 5) insertAfter() » 4) inArray() » 3, 2, & 1) getCookie(), setCookie(), deleteCookie() » Last but not least, a bonus function: The Prototype Dollar Function » And so will they all… |
|