Tuesday, July 3, 2007

Executing JavaScripts on Page Load

Assigning a handler to window.load directly is not such a great idea, since it erases the callbacks that may have been assigned earlier.

I came across an alternative by Peter-Paul Koch here

This small snippet of Javascript executes onload events in such a way that previous events are not lost, by checking if there are any, and executing them before executing the one in question.


Powered by ScribeFire.

0 comments: