|
To access the contents, click the chapter and section titles.
HTML 4.0 Sourcebook
For this and other reasons, the downloaded Java program is not considered a full application, but rather a miniapplication or applet. Current browsers let you include Java applets using the APPLET element, as illustrated in Figure 2.32. This element can contain two important parts: PARAMETER elements that define parameters required by the running applet and regular HTML markup that is displayed by browsers that do not understand
APPLET or that are incapable of running Java programs. The APPLET element can take several attributes: HEIGHT, WIDTH, HSPACE, VSPACE, and ALIGN have the same meanings as with images, while CODEBASE indicates the URL where the applet software comes from, and CODE gives the name of the actual applet program at this URL. Figure 2.33 shows the resulting document as displayed by the Microsoft Internet Explorer 3.0 browserboth Microsoft and Netscape support Java in their browsers. The applet appears as the graphic to the right, which is an animation that illustrates binary search tree rotationsan important concept in computer science. The reader can actually click on the balls causing these rotations and, in doing so, learn about this important database concept. Like EMBED, APPLET is being replaced by the more flexible OBJECT element. OBJECT is supported by both Netscape Navigator 4 and Internet Explorer 4. Java applets offer enormous promise for building dynamic, interactive Web pages. However, writing Java programs is not like writing HTML. Java is a fullblown programming language, comparable to C++, so that writing Java programs is complex and not for the faint of heart! Also, Java applets, accessed over the Web, are often large files that take a long time to downloadit is not uncommon to wait minutes for large applets to arrive. Also, as with plugins, you need modern, fast machines with lots of memory to run applets with acceptable speed and response timesa 100 MHz Pentium processor with 16 MB of memory is a good minimum configuration. Thus, be careful when jumping on the Java bandwagon in case you find yourself delivering content that cannot be used by your users. Possibly the best environment for Java is inside a corporate intranet, where you can predict the types of equipment and software accessible to the users. Possibly the worse environment is one where you want to make Web resources accessible to the widest possible audience. Document Scripting: Javascript and VBScriptIf you can download programs and run them on the browser, why cant you also incorporate programs within the HTML documents? This is now possible using two scripting languages: JavaScript, developed by Netscape and Sun Microsystems, and VBScript (Visual Basic Script), developed by Microsoft. Scripting languages are discussed in Chapter 7. Lessons from Example 12
Exercises for Example 12Try visiting some sites containing applets to get a flavor for what they can do and also to get a flavor for the time it takes to download a large applet over the Internet. A large repository of Java applets can be found at: This is a good place to find Java examples. You might even find an applet you want to use.
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement. |