利用Javascript探测网络浏览器的插件程序
<SCRIPT LANGUAGE="JavaScript"><!-- var can_play = false;
if (navigator.mimeTypes[mimetype] != null) { if (navigator.mimeTypes[mimetype] .enabledPlugin != null) { can_play = true; document.write('<EMBED SRC="sound.mid" HIDDEN=TRUE LOOP=FALSE AUTOSTART=FALSE>'); } } }
if (document.embeds && can_play) { if (navigator.appName == 'Netscape') document.embeds[0].play(); else document.embeds[0].run(); } }
if (document.embeds && can_play) document.embeds[0].stop(); } //--></SCRIPT>
<A HREF="#" onMouseover="playSound()" onMouseOut= "stopSound()"><IMG SRC="image.gif" WIDTH="100" HEIGHT="100" BORDER="0"></A> |
正在阅读:Javascript实例教程(4) 探测浏览器插件Javascript实例教程(4) 探测浏览器插件
2004-02-14 09:33
出处:PConline
责任编辑:pjl
键盘也能翻页,试试“← →”键