Friday, September 29, 2006

Levels of JavaScript Knowledge

Dean Edwards rules! Look at the comment #77, though :)

I understand level 5, but I don't know yet why

var button = document.getElementById("hello");
button.addEventListener("click", function(event) {
hello(WORLD);
}, false);

is better than

var button = document.getElementById("hello");
button.onclick = function() {
hello(WORLD);
};

Could someone explain it?