[whatwg] Return values of on* event handlers

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?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Thursday, 31 May 2007 22:13:30 UTC