Java and ActiveX


Java and ActiveX are both programming languages used to create Web applications. Java (created by Sun Microsystems) is platform independent (meaning that PCs, Macs, and UNIX systems can interpret the commands in the application). ActiveX (created by Microsoft), however, only works with the Internet Explorer browser. It is nearly impossible to guarantee that your visitors will use this browser unless you employ the annoying tactic that so many developers have chosen: preceding any application with a note warning your visitors that they must download the correct browser before they can view your pages.

How Do They Work?

Both Java and ActiveX work under the principle of object-oriented programming. The idea is that each piece of code should be treated as a separate entity, which can be used repeatedly in many types of environments, including the Web.

Both elements can be embedded in your Web pages using HTML's <object> tag. An <object>, in HTML, can be an image, an application, or another HTML document. The attributes are the important distinction. The first example (which follows) would be used to include a Java applet. The second example would be used to include an ActiveX control (or application).

<object codetype="application/java-archive"          codebase="http://www.myWeb.com/apps/"          class> </object> <object codebase="http://www.myWeb.com/apps/"          data="my.activex.program">          class </object>


In the first example, the classid attribute is the name of the Java applet being called by the <object> tag. This same information appears in the data attribute for ActiveX programs. In both examples, the codebase attribute indicates the directory in which the application can be found. However, the codebase attribute itself is not necessary. The entire URL (including the base directory information) could be included in the classid (for Java) and data (for ActiveX) attributes rather than including the separate codebase attribute.

The ActiveX classid attribute deserves some explanation. Other than telling you that the string of letters and numbers actually represents a URL, the best help I can give is to inform you that any ActiveX control that you choose to use in your Web page includes the appropriate classid information so that you can copy it into your tag.

Tip

Find information about Java and download some fun Java applets at http://java.sun.com/applets/index.html.

You can download ActiveX controls at http://www.download.com/2001-2206-0.html.




Sams Teach Yourself HTML in 10 Minutes
Sams Teach Yourself HTML in 10 Minutes (4th Edition)
ISBN: 067232878X
EAN: 2147483647
Year: 2004
Pages: 151
Authors: Deidre Hayes

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net