Elsewhere on the 'Net - Events

Events elsewhere on the 'Net.
Part of JavaScript.


22 September 2009

WebKit Page Cache II – The unload Event

Very interesting discussion of the problems the unload event poses for browser vendors. Introduction of the pageshow and pagehide events.

Events | Permalink

11 September 2009

Touching and Gesturing on the iPhone

Useful overview of the (iPhone proprietary?) touch events.

Events, iPhone | Permalink

4 April 2009

Detecting event support without browser sniffing

Kangax explains how to detect whether browsers support events.

The trick is that, say, document.onclick exists as a property even if no event handler is set (except in Mozilla). Read out whether the property exists, and you know if a browser supports an event. (It's slightly more complicated than that, but not much.)

Events | Permalink

24 March 2009

Callbacks vs Events

Dean Edwards explains a tricky bit of scripting: how to prevent an error in one event callback (say, a load or DOMContentReady event) from blocking another event callback.

Not only is this useful in and of itself, but it's also gratifying to see that Dean

  1. blogs once more
  2. has a new domain

So I expect all the stuff we discussed over beers and on mailing lists to be blogged forthwith. Starting now.

Events | Permalink

7 October 2008

Introducing onFocus and onBlur

The YUI team has taken my research into delegating the focus and blur events and included it in the brand new YUI 2.6.0

Use of the technique turned out to matter especially for creating and removing modal dialogs. When creating such a dialog, all focus events elsewhere on the page have to be redirected to it; after all the point of a modal dialog is that it cannot lose the focus except when you click on the Close button.

Until now YUI set a focus event on every single element on the page, an action that's costly in terms of performance. However, now they can just set one generic event at (presumably) document level, and that brings modal dialog creation time back by about 50%, and cleanup time by about 98%.

Now THAT's what I call performance gains. Cool work.

Events | Permalink

17 April 2008

A Good Enough addEvent

Two and a half year after my failed addEvent recoding contest, filosofo posted an ultra-short function that mends the this problem.

Also, he explains why my contest failed: my requirements were too strict. Filosofo used a trick that precludes a removeEvent function from working, because he never needs one. Truth to tell, I rarely need one either, though it's absolutely indispensable in my recent events test pages.

All in all this is interesting to read, for all its brevity.

(Via Scott Andrew.)

Events | Permalink

11 November 2007

JavaScript Madness: Keyboard Events

A valiant try at defining the browser incompatibilities surrounding the key events. Yes, this is complicated. In any case I'm glad somebody has done some work; I'll probably use this page once I get back to describing the key events and their problems.

Events | Permalink

28 September 2007

DOMContentLoaded for IE, Safari, everything, without document.write

Stuart's solution for the onload problem.

onload | Permalink

16 June 2007

IE Fires Onresize When Body Resizes

The resize event fires also when the <body> element is resized. I knew that, but I forgot it. Thanks to Jonathan for reminding me.

Events, IE | Permalink

2 May 2007

Timing and Synchronization in JavaScript

Detailed treatment of how browsers handle events, with emphasis on the timing: exactly when does an event handler fire and what does the user notice?

Also treats batches of events (mousedown-mouseup-click), event queuing (when an event occurs while another event handler is still running, the browser waits for the earlier event handler to quit), how timeouts are somewhat like events, and many, many more interesting details.

Required reading for any JavaScripter.

(Via Simon.)

Events | Permalink

JavaScript and Screen Readers

A practical example of catering for screen readers when creating a nify JavaScript effect. Useful tips.

Events, Screen readers | Permalink

8 April 2007

JavaScript Keyboard Accessibility

The nuts and bolts of keeping a foldout menu keyboard accessible.

Accessibility, Events | Permalink

2 April 2007

More on IE and window.event

David Flanagan discovers yet more weirdness in IE's window.event.

Events | Permalink

25 October 2006

IE, event objects, and attachEvent()

David Flanagan discovers that an event object is passed to event handlers set with the Microsoft proprietary attachEvent() method. This object is not the same as window.event, but contains the same properties.

Everybody kind of assumed that IE only used window.event, but nobody ever seems to have tested it. My book doesn't mention this fact, although I don't think I ever denied the existence of these event objects, either.

I wonder how many more of these curiosities are hidden deep in the browsers' bowels.

Events, IE | Permalink

13 September 2006

Text-Resize Detection

An onFontResize event handler created by Chris Heilmann and Lawrence Carvalho.

I had a similar idea a few months ago, but never did anything with it because I couldn't find a way around the inevitable interval. Essentially you have to continue running a check function for as long as the user stays on the page. That's no problem if you have only one such function, but what if we get many more custom events like this, and the browser has to check dozens of them every 1/5th second or so?

Regardless of this potential problem it's an interesting idea.

Events | Permalink

25 July 2006

Mouse wheel programming in JavaScript

On handling the mouse scroll wheel.

Events | Permalink

24 July 2006

JavaScript event tests part 1: onmouseover

Gez Lemon studies the mouseover event in screen readers. Part 1 of a series; I can't wait for the next installment.

Events, Screen readers | Permalink

20 June 2006

window.onload (again)

Dean returns to the onload problem.

onload | Permalink

4 May 2006

AJAX and Screenreaders: When Can it Work?

James Edwards discusses screen reader JavaScript support. Chaotic.

Accessibility, Events, Screen readers, Tests | Permalink

15 March 2006

Results for JavaScript - Part 2: Navigating forms

Which screen readers support which events?

Accessibility, Events | Permalink

23 January 2006

JavaScript Cursor Position

An updated cursor position script. It turns out that for IE's sake in Strict Mode you have to subtract clientLeft/Top.

Events | Permalink

19 January 2006

Resolution dependent layout update

Despite the title this post is really about the problems the load event can have (takes too long), and problems in IE 5.0 and 5.5 when you directly include your JavaScript calls at the end of the body (document.body not yet available).

Events | Permalink

18 October 2005

Faulty Firing

Detailed investigation of the order of events in all browsers when you click on an input and/or a label. Excellent research.

Events | Permalink

30 September 2005

Mousewheel scrolling event in Mozilla

Stuart Langridge explains a Mozilla event that fires when you scroll with the mouse wheel. It's a bit silly to use a separate event when the scroll event is also there, but it's useful to know that you can actually detect the mouse wheel in Mozilla.

Events, Mozilla | Permalink

25 September 2005

window.onload - An Alternative Solution

The other solution to the window.onload problem: HTCs.

onload | Permalink

24 September 2005

The window.onload Problem - Solved!

The load event fires when the entire page, including images, has been loaded. If clueless users upload 5M bitmaps to their sites, the event may fire far too late and the user may see all kinds of odd things happening while he's already doing something on the page.
What we need is a load event that fires when the document structure is complete, but that does not wait for the images. Dean Edwards provides. IE and Moz only, but it's a nice start.

onload | Permalink

29 August 2005

Breaking onload limits

Useful overview of the problem with the load event handler and possible solutions, including their drawbacks.

onload | Permalink

This is the linklog of Peter-Paul Koch, mobile platform strategist, consultant, and trainer. You can also visit his QuirksBlog, or you can follow him on Twitter.

Atom RSS

Category rchives: