If not - conditional statement

Hello all - whats the conditional statement to use in the <head> tag to tell a browser to ignore a piece of javascript?

I have a piece of script that runs great on all browsers other than Chrome and I want to exclude it from being seen/used on Chrome.

Whats the conditional <!–[if XXXX]> statement to wrap around it?

Is it actually causing problems for Chrome, or is it just not running? If it isn’t doing anything bad, I would just leave it as it is…

Yeah, I’ve got to go with the crowd on this, instead of not sending it to chrome - FIX IT so it works.

But as a Opera user I’m sick of scriptards basically telling me to **** off, so the notion of saying to another major browser “no” doesn’t float with me.

Though what you are looking for is called browser sniffing, and you’d have significantly more success asking about this in the javascript area instead of the HTML one… since pretty much anyone who understands building websites PROPERLY will tell you ‘sniffing is bad’… while your javascript for everything whackjobs will tell you a hundred different ways of doing it in the script.

Only Internet Explorer read conditional comments. As Ralph wrote, why not fix the script to run in Chrome too?

So far as I know, that code doesn’t exist yet. You could sniff the browser with JS, but it would be better to find out why it’s not working in Chrome and address that. :slight_smile:

There are PHP and js browser sniffers out there you just have to search a bit. But like others said I’d just fix it.