Previous Example-|-Next Example-|-Return to Chapter Listing

Example 13.11
Finding Out if the Browser Has Specific Plug-ins

[This example works with Netscape Navigator 3 and 4. It will not work in Internet Explorer 3.]

This simple script checks to see if a particular MIME type can be handled by the browser, then checks to see if there's a plug-in for the handler. Then it displays the MIME type's description, and the name of the plug-in.

First, we'll see if there's audio/x-midi support, and if there's a plug-in--
[Note that Netscape Navigator comes with a MIDI plug-in.]

Now we'll check for text/html, which the browser handles itself (without a plug-in or viewer)--

Now we'll check for a MIME type you definitely won't have: text/x-bingbong--


We have this in the HEAD: Then this form in the BODY:
Previous Example-|-Next Example-|-Return to Chapter Listing