i am dustin diaz

a JavaScriptr...

boosh.

don't worry about it.

Event Capturing is near evil

If you're using a browser that implements the EventListener interface (W3 model), try this out for size

addEventListener useCapture

document.addEventListener('click', function(e) {

    e.stopPropagation();

    e.preventDefault();

}, true);

What do you think this will do? ...Yeah, you're right. If you have Firebug, copy the four lines above, then navigate to any webpage such as this one just for testing, open up your Firebug console command line, and paste it in there and run it. Now try clicking on any link in the document. Pretty sweet? Or almost near evil?

When Internet Explorer finally sports a W3 Event model, keep this little doozy in mind. I will admit, however, that there were times when I could have really used capturing, so don't get the wrong impression. Cheers.

this is who i am

Hi, my name is Dustin Diaz and I'm an Engineer @ObviousCorp. Previously @Twitter, @Google, and @Yahoo, author of Strobist® Info co-author of JavaScript Design Patterns, co-creator of the Ender JavaScript Framework, a Photographer, and an amateur Mixologist. This is my website. Welcome!

On this site I write about JavaScript. You can also follow along with my open-source work on Github.

This site is optimized and works best in Microsoft Internet Explorer 6.