示例代码如下:
document.writeln("<TABLE BORDER=1><TR VALIGN=TOP>",
"<TH ALIGN=left>i",
"<TH ALIGN=left>名称",
"<TH ALIGN=left>文件名",
"<TH ALIGN=left>描述",
"<TH ALIGN=left>类型数</TR>")
for (i=0; i < navigator.plugins.length; i++) {
document.writeln("<TR VALIGN=TOP><TD>",i,
"<TD>",navigator.plugins[i].name,
"<TD>",navigator.plugins[i].filename,
"<TD>",navigator.plugins[i].description,
"<TD>",navigator.plugins[i].length,
"</TR>")
}
document.writeln("</TABLE>");
关于plugins对象的详细说明,可以查看这篇文章
http://learn.tsinghua.edu.cn:8080/2005310285/javascript_ref/brow1.htm#1013016
目前只发现在firefox下有效果,ie下正在研究。
关于检测ie下安装插件的问题,先暂时查看下这篇文章吧。
http://hi.baidu.com/sodarfish/blog/item/541b7f11856f7e15b8127bc1.html