By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,374 Members | 1,764 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,374 IT Pros & Developers. It's quick & easy.

Detecting plug-ins

P: n/a
Hi,

I am running a script to find out the plug-ins installed in my pc. I run the
same script both in IE 6.0 and Netcape 7.1, but I got different results. IE
says "JavaScript couldn't find any plugins", and Netcape returns a table
listing all plug-ins. Can anyone tell me why this happens? Thanks!

---------------------------the script-----------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>What are my plugins?</title>
</head>
<body bgcolor="#FFFFFF">
<script language="Javascript" type="text/javascript">
<!-- Hide script from older browsers

if (navigator.plugins && navigator.plugins.length > 0) {
document.write("You have the following plugins: <table cellspacing='4'
cellpadding='4'>")
document.write("<tr><th bgcolor='#CCCCCC'>Name<\/th><th
bgcolor='#CCCCCC'>Filename<\/th><th
bgcolor='#CCCCCC'>Description<\/th><\/tr>")

for (i=0; i<navigator.plugins.length; i++) {
thisPlugin = navigator.plugins[i]
document.write("<tr valign='top'><td bgcolor='#CCCCCC'>" +
thisPlugin.name)
document.write("<\/td><td bgcolor='#CCCCCC'>" + thisPlugin.filename)
document.write("<\/td><td bgcolor='#CCCCCC'>" + thisPlugin.description +
"<\/td><\/tr>")
}
document.write("<\/table>")
}
else {
document.write("JavaScript couldn't find any plugins")
}

// End hiding script from older browsers -->
</script>
</body>
</html>
------------------------------------------
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <tUq2d.11701$iS2.8717@trnddc09>, qi******@verizon.net enlightened
us with...
Hi,

I am running a script to find out the plug-ins installed in my pc. I run the
same script both in IE 6.0 and Netcape 7.1, but I got different results. IE
says "JavaScript couldn't find any plugins", and Netcape returns a table
listing all plug-ins. Can anyone tell me why this happens? Thanks!
if (navigator.plugins && navigator.plugins.length > 0)


Only netscape has navigator.plugins, so yeah, IE wouldn't find anything.
There is no navigator object in IE.

See:
http://www.rgagnon.com/jsdetails/js-0056.html

--
--
~kaeli~
Found God? If nobody claims Him in 30 days, He's yours to
keep.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.