[thelist] Script for M$IE only, or not

Ian Anderson ian at zstudio.co.uk
Sun Apr 2 04:06:38 CDT 2006

Richard Bennett wrote:

> So the idea is not to use object detection to find out which browser the user 
> has, but to find out if their browser supports the object you want to use.
> If you really want to do it like you asked, you can probably use the 
> window.createPopup, as that is IE-only. Ie5.5 and after though.

Totally agree. But in cases where you _do_ need to know the browser for 
some other reason - for instance, writing out a style sheet for NN4 - I 
have used object detection for objects that are supported only in the 
specific browser. e.g.

if (document.all) {
   // this is definitely IE - nothing else
   // has the all collection here
if (document.layers) {
   // this is probably NN4 - there may be one other really
   // obscure browser that also supports this

Hope this helps



zStudio - Web development and accessibility

Snippetz.net - Online code library
File, manage and re-use your code snippets & links

More information about the thelist mailing list