Obviously I agree that IE6 should be banned. But since most big
corporations (and clients) still use it, I as a front-end developer
find that we need to keep supporting it.

But indeedly, conditional statements are once again the key.
Add this to the head of your page:
<!--[if ie 6]>
<script>
document.getElementsByTagName("html")[0].className += (" ie6");
</script>
<![endif]-->

This adds the classname .ie6 to the <html> tag. Easy to check for this
in your scripts.
For some sites I use this to set the class .js aswell, so you can do
CSS tricks like .js .hide to hide elements if users have javascript.

Remember to put all the other JS just before the </body> tag so it
won't interfere with the loading of the rest of your document.

.Jorn


On 7 apr, 05:02, RobG <rg...@iinet.net.au> wrote:
> On Apr 7, 7:33 am, Joe McCann <joseph.is...@gmail.com> wrote:
>
> > Ricardo,
>
> > I see your point now.  I was under the impression $.browser was
> > becoming deprecated so $.support would take it's place.  But given the
> > fact that I currently need to run one method forIE6, I will continue
> > to use the $.browser method.
>
> If you describe the reason you are trying to specifically detect IE 6,
> you might discover a work around that doesn't require it.
>
> > In regards to conditional comments, this becomes a performance issue
> > where an additional JavaScript request is made on the server and has
> > to download, impacting page load speed.
>
> There is no need for a separate file - and even if there was, the
> extra download will likely go unnoticed.  Non-IE 6 users certainly
> won't notice.
>
> >  I would rather take my
> > chances with a browser sniff in one JS file than have to load an
> > additional JS file AND maintain that JS file.
>
> You have to maintain the code anyway, besides, the conditional comment
> can be used to set a global variable without the need to load a
> separate file.  The only difference is that a conditional comment is
> used to detect the browser rather than the user agent string.
>
> --
> Rob

Reply via email to