On Wed, Feb 25, 2009 at 2:26 PM, Matt Kruse <m...@thekrusefamily.com> wrote:
>
> On Feb 25, 11:59 am, brian <bally.z...@gmail.com> wrote:
>> Conditional Comments are great and all (best thing to come from MS
>> since asynchronous requests) but they're not the best solution here,
>> IMHO. Whether it's the browser or a feature that needs detecting, it's
>> often required somewhere in the middle of some routine. Using CC,
>> you'd need to duplicate your method, object, whatever.
>
> That's not true. I do things like this:
>
> // This is a better check than looking at userAgent!
> useIframe:/*...@cc_on @*//*...@if (@_win32) true, @else @*/false,/*...@end @*/

I stand corrected. I forgot about using them that way. I generally
only use them for CSS because I like to keep MS-specific stuff in its
own file.

> Anyone who thinks they have a need to check the browser would benefit
> from reading more about feature detection and why it is almost always
> a better strategy. It just doesn't come naturally at first for many,
> and you might struggle through some "yeah, BUT!" moments, but in the
> end you'll be better off.

Just to clarify, I have no problems with using feature, rather than
browser, detection. I do think this is a smart move.

Reply via email to