spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

Developer News
Google Going Native With Chrome
Mozilla Fixes Firefox Flaws as 3.5 Release Nears
Microsoft and Novell Still Bosom Buddies

JavaScript Tip of the Week for August 19, 1996: Checking for Plugins and File Types

Note: This plugins tip has been improved to help you detect all plugins.

Netscape 3.0 allows you to detect which plugins and file types are incorporated into a browser. This week's tip will show you how to utilitize those functions. This Script displays a list of all of the plugins that are installed on a browser, their file names, and their descriptions: This script is not very useful in and of it itself, but you can use it as a tool to detect specific plugins. Using a simnple two line function, you can easily detect any specific plugin. For instance, I know that you installed on your browser. I also know that you Now, to detect plugins easily and efficiently, just use this function:
    function plugdetect(plugName) 
    {
        if (navigator.plugins[plugName]) return true;
        else return false;
    }
Just use a simple if statement with the name of the plugin to put the function to work:
    if (plugdetect("LiveAudio") == true) 
        document.write("have the LiveAudio plugin");
    else document.write("do not have the LiveAudio plugin");
In place of "have the LiveAudio plugin" you could put an EMBED tag and the display a LiveAudio control. Otherwise you could have the script ask you to get the plugin.

As you can see, this is a simple but effective JavaScript function. I hope you find more creative ways than I have to use this tip. Untill next time... I'll see you on JavaScript Tip of the Week.

Source

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
XML and PHP Simplified · Creating a ASP.NET Contact Form · Data Filtering with PHP
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Intel to Host Live Nehalem Q&A · 12 Tips to Troubleshoot Network File-Sharing · 10 Tips for Selling on Kijiji