On Oct 10, 1:56 pm, "Justin Perkins" <[EMAIL PROTECTED]> wrote:
> On Thu, Oct 9, 2008 at 10:42 PM, RobG <[EMAIL PROTECTED]> wrote:
> > Interesting, but it relies on browser sniffing and proprietary
> > properties.
>
> What's wrong with that?

There are many, many articles on why browser sniffing should not be
used as a general strategy - here's one:

<URL: http://www.jibbering.com/faq/faq_notes/not_browser_detect.html#bdTop
>

In general, proprietary methods should not be used for code on the web
as they are implemented differently in different browsers - cautious
use of innerHTML is one of the few exceptions.  The sniff for Opera is
because its innerText is different to IEs, so one poor choice has led
to another.

The code doesn't work in Prototype.js version 1.6 - it doesn't deal
with inline script and returns different results in different
browsers.  Also, there doesn't seem to be any point in using [\n\r\s]
in the RegExp - what browser supported by Prototype.js doesn't include
new lines and returns in white space?  That indicates non-compliance
with ECMA-262.


> If it is in the name of performance, I say go for it.

Performance is not the issue - fewer lines of code doesn't necessarily
mean faster performance.

Anyhow, performance is moot if the code doesn't work.  Beware early
optimisation - it can cause more issues than it solves.


--
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to