DR. WEBSITE: Differences Between GIFs and Java Animations; Automatic Date and Time Displays Dear Dr. Website®: I notice many banner ads are animated GIFs, rather than Java animations. Is there a difference in how they load or the system resources they take to run?
By David Fiedler and Scott Clark
Some of it is simply a matter of reaching more viewers. Not all users are using Java- enabled browsers; however, most are using browsers that are capable of displaying animated GIFs. Java applets are more resource-intensive and usually take longer to load than animated GIFs.
Most applets with animation require actual image files anyway, and they, too, are a part of the download process. This is one reason why you see so many animated GIFs (versus Java applet animations). However, if the Java applet loads fast, and has a nice effect, there's no reason not to use it. Just make sure you place an alternate image tag inside the applet tag for those without Java, i.e.:
<APPLET CODE="fx.class" WIDTH=200 HEIGHT=100> <IMG SRC="fx.gif"> </APPLET> This way, those viewers will see an alternate image instead of a blank area where the applet should be.
You can use the other date functions, such as getYear(), getMonth(), etc., to extract the year, month, day, hour, and minute. Then you'll have to parse the month and the hour to get it into a long date format, i.e., March 12, 1997, 5:10 instead of 03/12/97, 17:10. Here's the code to do it:
Webdeveloper.com's home page
Back to Home Page
Keywords: html, site_management