spudly.shuoink.com

the best way to predict the future is to implement it

Entries Comments


my version of the popular addEvent()

8 December, 2007 (10:35) | JavaScript | 4 comments

Ok, so here is my version of the popular addEvent() javascript function.
usage:
event_listener.add( object, event_type, function );
Example:
function init() {
alert(”the page is fully loaded”);
}
event_listener.add(window,”onload”, init);
-OR -

event_listener.add(window, “onload”, function init() {
alert(”the page is fully loaded”);
});
Then you can also remove events as well. Remove them in the same manner you created them. Like [...]