[whatwg] Return values of on* event handlers

Ian Hickson wrote:
> On Mon, 24 Jul 2006, Stewart Brodie wrote:
>> Dean Edwards <dean at edwards.name> wrote:
>>> Boris Zbarsky wrote:
>>>> Consider the following testcase:
>>>>
>>>> <!DOCTYPE html>
>>>> <a href="http://www.example.com" onclick="return 0">Click me</a>
>>>>
>>>> Should clicking the link load www.example.com?
>>> Yes. You should explicitly return "false" to cancel an event.
>> I've had to deal with customer fault reports saying that "return 0" 
>> should cancel the event, so have to allow for numbers here too.  I'm 
>> assuming that means that one or more of the major desktop browsers 
>> permits this.
> 
> In my testing, IE doesn't do that; they require 'false' exactly. Without 
> more support for this, I'd be reluctant to change it.
> 
> Could you elaborate?

The current release of iCab (3.03) treats 'return 0' the same as 'return 
false'.

On the other hand, all these browsers do not in my testing:

IE 3, 4, 5.0, 5.5, 6, 7 (Windows)
IE 5.2 (Mac)
Netscape 4, 8 (Windows)
Netscape 6, 7 (Mac)
Mozilla 1.7, Firefox 1.5, Firefox 2 (Mac)
Opera 3, 4, 5 (Windows)
Opera 6, 7, 8, 9 (Mac)
Safari 2.0.4 (Mac)

-- 
Bill Mason
Accessible Internet
whatwg at accessibleinter.net
http://accessibleinter.net/

Received on Thursday, 31 May 2007 23:00:57 UTC