[whatwg] Return values of on* event handlers

Ian Hickson ian at hixie.ch
Thu May 31 22:13:30 PDT 2007


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.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list