detecting plugins

They have: 2 posts

Joined: Oct 1999

I have a nice script which detects what plugins are loaded. However this only seems to work on Netscape Navigator. Does any one know why it does not work or what changes I need to make to make it work on Internet Explored ?

The code is

<HTML>
<HEAD>
<TITLE>Got Flash?</TITLE>
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
<!-- Hide script from older browsers
hasFlash = false
for (i=0; i<navigator.plugins.length; i++) { alert("plugin")
if (navigator.plugins[i].name.indexOf("Shockwave") >= 0) {
hasFlash = true
}
}

// End hiding script from older browsers -->
</SCRIPT>
</HEAD>
<BODY BGCOLOR=WHITE>
<H2>
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
<!-- Hide script from older browsers

if (hasFlash) {
document.write("You have Flash, you lucky person, you!")
}
else {
document.write("Sorry, you don't have Flash.")
}

// End hiding script from older browsers -->
</SCRIPT>
</H2>
</BODY>
</HTML>

all help more than welcome

Mark Perry