W3C home > Mailing lists > Public > public-webapi@w3.org > April 2006

Re: [comment] XMLHttpRequest Object - Address Extensibility

From: Jim Ley <jim@jibbering.com>
Date: Sat, 22 Apr 2006 12:30:05 +0100
Message-ID: <00c001c66600$1a544000$2402a8c0@Snufkin>
To: "Web APIs WG \(public\)" <public-webapi@w3.org>

"Bjoern Hoehrmann" <derhoermi@gmx.net>
> I have no idea what the code is supposed to do and what constraints
> there are. It is not clear, for example, why you cannot just use e.g.
>
>  obj.MozFoo = obj.WebkitFoo = obj.OperaFoo = 0.7;

Such code would throw a run time error in certain IE6 installations, and 
other less common UAs, assuming obj is a DOM object or even more often in 
certain other types of host objects.   So they would need to be protected 
against as they are in the example, as I say the only bad thing I can see is 
the syntax, the alert is I would imagine a placeholder in an example for a 
more realistic fallback depending on the situation.

> There may be good reasons for all of this, of course,
> but that doesn't help us make progress on this matter.

I think it's a very good example of why VendorFoo is not an option, it 
forces code like the previous to be created, as it's the only way to prevent 
errors, without continous try/catch blocks, I'd suggest that was worse style 
than the if (obj.x) method as that is more well understood from the days 
when try/catch wasn't available.

Cheers,

Jim. 
Received on Saturday, 22 April 2006 11:31:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:54 GMT