venerdì, agosto 08, 2008

Using Multiple JavaScript Onload Functions

An interesting article. I’m particularly intrigued by the “The addLoadEvent Function” discussed about halfway down the page.

"The way this works is relatively simple: if window.onload has not already been assigned a function, the function passed to addLoadEvent is simply assigned to window.onload. If window.onload has already been set, a brand new function is created which first calls the original onload handler, then calls the new handler afterwards."