Java Reference
In-Depth Information
2. Use the new noexternaldata attribute to specify that no external access of data is used.
<object noexternaldata=”true” classid=”CLSid:6BF52A52-394A-11d3-B153-00C04F79FAA6”>
<param name=”URL”
value=”http://msdn.microsoft.com/workshop/samples/author/dhtml/media/drums.wav”/>
</object>
The URL parameter will be ignored, and no external data from the URL, in this case a .wav fi le, will be
accessed.
Summary
In this chapter you looked at how you can use plug-ins and ActiveX controls to extend a browser's func-
tionality. You saw that:
Internet Explorer supports ActiveX controls, and to some extent plug-ins, on Windows oper-
ating systems. Non-IE browsers have good support for plug-ins but do not support ActiveX
controls.
Most creators of plug-ins also provide an ActiveX control equivalent. Internet Explorer and
other browsers are incompatible as far as the installation of plug-ins and ActiveX controls goes.
Plug-ins are embedded in a web page by means of the
<embed/> element. You let non-IE
browsers know which plug-in to embed by specifying either a source fi le or a MIME type using
the src and type attributes of the <embed/> element. If you defi ne a value for the <embed/>
element's pluginspage attribute, users who don't have that plug-in installed will be able to
click a link and install it.
You can fi nd detailed information about what plug-ins are installed on your non-IE browser, as
well as their descriptions and types, by typing about:plugins in the location bar.
To use script to check if a user has a certain plug-in, you can use the
navigator object's
plugins collection. For each plug-in installed, there will be a Plugin object defi ned in this col-
lection. Each Plugin object has the properties name , description , filename , and length ,
which you can use to determine if a plug-in exists on the user's computer. You can also use the
navigator object's mimeTypes collection property to check if a certain type of fi le is supported.
Internet Explorer supports ActiveX controls as an alternative to plug-ins. These are embedded
into a web page using the <object/> element. Specify which ActiveX control you want by
using the classid attribute. If you want to have controls automatically install for users who
don't have a particular control already installed, you need to specify the codebase attribute.
Any parameters particular to the control are specifi ed by means of the
<param/> element,
which is inserted between the opening and closing <object> tags.
You can check whether a control has loaded successfully using the
readyState property of the
Object object, which returns a number: 0 if the control is not installed, 1 if it's still loading, 2 if
it has loaded, 3 if you can interact with it, and 4 if it's installed and ready for use.
Search WWH ::




Custom Search