Opera Web Standards Curriculum article: Handling events with JavaScript
During the fall, I put a fair amount into writing an article for the Opera Web Standards Curriculum, and now it has finally seen the light: Handling events with JavaScript!
Just as Chris Mills outlines in Opera web standards curriculum: JavaScript in town!, it is finally time for the JavaScript articles of the curriculum to see the limelight, and boy, do they have some talented authors (+me π ).
Background
Chris has been on my back about writing something for him, from all the time back when he was the Senior Editor at friends of ED. I have always declined, not out lack of interest, but other obligations and things to tend to. With the Web Standards Curriculum, though, I find it to be a thing to good to miss out on, trying to help web developers globally to increase their coding skills and ultimately make the web a better place. π
I was a bit scared at first, describing event handling, which is very tricky and hard to get right with all its caveats, but looking at the final result, I think it at least gives a fair introduction into event handling. Therefore, a lot of hard work and harsh words later, it is very satisfying to see this article published!
A glimpse into the editor – writer relationship
As a little sidenote, perhaps some of you are interested into an insight into how such a relationship between an editor and a writer, in such a professional context as this, really is? Out of respect for Mr. Chris Mills, I won’t publish anything he wrote to me, but here are some quotes from my e-mails to him:
I mean, really… I understand you wanting to have a good article, but to put such pressure at me at this time…
I did my best, and I didn’t want to write the stinking article in the first place!
bla bla bla… waffly?! bla bla bla
Really, I… just, i just… Oh man, here comes the tears again…
Oh, so you’re accustomed to “serious writers”? Can’t even dignify me with a reply? Oh you little…
Go read!
Anyway, after that little sidestep, go read Handling events with JavaScript now! Hope you like it!
LOL – I love you man π
I think you should publish some of our extended conversations…the chronicles of Dick Straaaaaaaaaaw, private investigator…
[…] am proud I was not as whiny as Nyman — if you saw excerpts of my emails to Mills & co they’d all say “oh, piss, […]
Chris,
It's mutual, dear. π
Regarding Mr. Straaaaaaaaw, I'm not sure the world is ready for him yet. π
Hi Robert,
I checked your article for errors and I hate to sound like a broken record but attachEvent does pass the event to the called function.
Aldrik,
It's interesting that you mention this. Actually, <code>attachEvent</code> do pass an event object, but as research has proven, it's a deep clone of the global event object (more reading in IE, event objects, and attachEvent()).
So, seeing that it in practice becomes the global event object, and to be more in line with other books and tutorials, it felt like the best route to take as I put it in the article.
However, it's an interesting topic for discussion, and something to consider whether it's worth delving into in an introductory article or not.