HTML and CSS Reference
In-Depth Information
Shockwave or Flash player, Adobe Acrobat Reader, and RealNetworks RealPlayer. Plug-
ins can be platform dependent and their MIME types can vary as well. If you are using
Firefox, go to the Tools menu and select Addons to get more information about the plug-
ins supported on your client. If using Internet Explorer, you will find the plugins[] array
is empty. You can manage add-ons by going to the Internet Explorer Tools menu and
clicking Manage Add-ons.
The plugins[] array of the navigator object (starting with Navigator 3) contains a com-
plete list of installed plug-ins and can be numerically indexed to see all plug-ins installed
for this browser. Each element of the plugins[] array represents a plugin object. The prop-
erties of the plugin object are shown in Table 10.2. When you use the HTML <embed>
tag in a document, you are creating a plugin object. Each instance of the <embed> tag cre-
ates another object (see <embed> and <object> tags for embedding objects on page 281,
Example 10.5).
Table 10.2 Properties of the plugin Object
What It Describes
A description of the plug-in.
The disk file name of the plug-in.
The number of elements in the plugins[] array.
The name of the plug-in.
<script type="text/javascript">
// No plug-ins for Windows IE. Firefox uses this program.
var num_of_plugins = navigator.plugins.length ;
for (var i=0; i < num_of_plugins; i++) {
var number=i+1;
document.write("<font color=red>Plug-in No." +
number + "- </font>"+ navigator.plugins[i].name +"
<br />[Location: " + navigator.plugins[i].filename + "]<p>");
alert("\nYou have " + number + " plug-ins installed!")
The length property specifies the number of elements in the plugins[] array. If us-
ing Internet Explorer for Windows, then you will need to use the HTML <object>
tag and identify a class ID.
The plugins[] array consists of a list of plug-ins that have been installed in this brows-
er. The for loop is used to go through the array, one by one, listing each plug-in.
Search WWH ::

Custom Search