Re: [comment] XMLHttpRequest Object - Address Extensibility

"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 UTC