DHTML Collections
Netscape Navigator® 3 up only.
Returns a reference to the collection of all Multipart Internet Mail Extension ( MIME ) types supported by the browser.
[ collMimeTypes = ] navigator.mimeTypes |
[ oObject = ] navigator.mimeTypes ( iIndex ) |
collMimeTypes |
Reference to an array of elements contained by the object. |
oObject |
Reference to an individual item in the array of elements contained by the object. |
iIndex |
Integer indicating the item to be returned. |
mimeTypes is an array of all MIME types supported by the client, either internally, via helper applications, or by plug-ins. Each element of the array is a mimeType object, which has properties for its type, description, file extensions, and enabled plug-ins.
For example, the following table summarizes the values for displaying JPEG images.
Expression |
Value |
navigator.mimeTypes [ "image/jpeg" ].type |
image/jpeg |
navigator.mimeTypes [ "image/jpeg" ].description |
JPEG Image |
navigator.mimeTypes [ "image/jpeg" ].suffixes |
jpeg, jpg, jpe, jfif, pjpeg, pjp |
navigator.mimeTypes [ "image/jpeg" ].enabledPlugin |
null |
This property returns an empty collection for Internet Explorer®.
The following script checks to see whether the client is capable of displaying QuickTime movies.
var mType = navigator.mimeTypes [ "video/quicktime" ] ;
if ( mType )
document.write ( "Click here to see a " + mType.description )
else
document.write ( "Too bad, can't show you any movies." )
navigator