Code to work out if a browser has flash?

  • Thread starter Thread starter WYSIWYG
  • Start date Start date
W

WYSIWYG

Guest
Hi, i am using the below javascript code to browser sniff FireFox to find out if it supports a shockwave plug-in and it works fine:

for ( i=0; i < navigator.plug-ins.length; i++ ) {
if (navigator.plugins.name == 'Shockwave Flash')
{
location.replace("new.html");
}
}

The problem with this is that when the code is used to browser sniff Internet Explorer it does not work. For some reason the plugins supported by IE are not in "navigator.plugins". How do I browser sniff IE properly? Thanks
 
Back
Top