Java Reference
In-Depth Information
Figure 13-10
Potential Problems
Plug-ins and ActiveX controls provide a great way to extend a browser's functionality, but they do so
at a price — compatibility problems. Some of the problems you may face are discussed in the following
sections.
Similar but Not the Same — Differences Among Browsers
Although a plug-in for non-IE browsers and the equivalent ActiveX control for IE may support many
similar properties and methods, you will often fi nd signifi cant, and sometimes subtle, differences.
For example, both the plug-in and ActiveX control versions of RealPlayer support the SetSource()
method. The following code works in IE:
document.real1.SetSource(“D:\\MyDir\\MyFile.ra”)
This code, however, will cause problems with the other browsers. To work with Firefox and the like,
specify the protocol by which the fi le will be loaded. If it is a URL, specify http://, but for a fi le on a
user's local hard drive, use file:///.
To make the code work across platforms, you must type this:
document.real1.SetSource(“file:///D:\MyDir\MyFile.ra”)
Differences in the Scripting of Plug-ins
When scripting the QuickTime plug-in for non-IE browsers, you embedded it like this:
<embed height=”0” width=”0” type=”audio/mpeg” src=”sound1.mp3”
pluginspage=”www.apple.com/quicktime/download”
enablejavascript=”true” name=”audioPlayer” />
Search WWH ::




Custom Search