Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Web
Expertise: Intermediate
Apr 21, 1999



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Detecting Browser Plug-Ins

Browser plug-ins, such as RealPlayer, Shockwave/Flash, Quicktime, and others, can add multimedia functionality to a Web site and help attract and retain visitors. If a particular visitor doesn't have a particular plug-in, however, the savvy Web designer will want to provide a different experience--an animated GIF, a Netscape sound, or something along those lines. It's possible to detect the presence or absence of any known plug-in with a JavaScript function, and then deliver content appropriately:
    function detect_plugin(name)  {
             if (navigator.plugins[name]) return true;
             else return false;
Just use a simple if statement with the name of the plug-in to put the function to work:
         if (detect_plugin("Beatnik") == true) 
             document.write("Beatnik code goes here");
         else document.write("No Beatnik - do something else");
Steve Renaker
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date