I like the title idea better. I think that is what we need sometimes. As things stand these days, this is a fairly good test of IE/Not IE:
Code:
if(!document.documentElement.filters){
alert ("Get IE, the most widely used browser because, I don't know how to code for other browsers.")
}
else {
alert("Ah, I see you've IE!")
}
Tongue firmly in cheek I think you can see that I don't think this is the very best of ideas. A better approach is (if there is any doubt that it is universally supported) to test for each method that you are using, providing an alternative method that is either supported by all or most other browsers. Sometimes there just isn't (or you can't figure one out) a good alternative. In a case like that, most of the time you can just skip the 'special effect' for other browsers and the script can still perform its basic function or (depending upon what that function is) the page can stand alone in other browsers without the script. Either way, there is no need to make any announcement about it.
This last idea is really key. Your page should be accessible to all browsers even if they have javascript turned off. That way, any twists and turns you take in a script won't matter, as long as no logical or coding errors are made.
If you were to give me the specifics of the script and the HTML it is meant to work with, I can probably come up with a way to make the script work cross browser, or at least degrade gracefully under those browsers that do not support it.
Bookmarks