HTML and CSS Reference
In-Depth Information
Listing 6-22. An offline.manifest File
CACHE MANIFEST
index.html
styles.css
main.js
This file should be provided as the attribute value of the manifest attribute on the html element (Listing 6-23).
The file should be served with the MIME type text/cache-manifest .
Listing 6-23. Using the Manifest File
<html manifest="offline.manifest">
Users will be requested to allow caching on their computer.
The online/offline state of the browser can be determined by JavaScript using navigator.onLine .
When the browser is offline, the data can be easily stored locally using the Web Storage API discussed earlier, that
is, the sessionStorage to retrieve data during a session or the localStorage to retain values for longer periods.
Offline web applications are supported by Firefox 3.5+, Chrome 1.0+, Safari 4.0+, and Opera 10.6+.
Java Applets
Java is an object-oriented, structured, imperative, cross-platform programming language. Java was originally
developed by Sun Microsystems, which is now owned by Oracle Corporation. Java can be used in a variety of contexts
on the client side as well as the server side, including applets, servlets, Swing applications, and JavaServer Pages (JSP).
Java applets are small applications for performing a specific task and are provided on web sites in a format called
Java bytecode, which can be executed by the Java Virtual Machine (JVM). Although Java applets can be substituted by
alternate technologies such as Flash, Curl, or Microsoft Silverlight, they are still present on the Web.
A Java applet should be provided by two object elements and self-closing parameters. The inner object is used
by Trident and the outer object by Gecko and other rendering engines. Listing 6-24 shows an example.
Listing 6-24. Java Applet Embedding with object
<object classid="java:bookflip.class"
type="application/x-java-applet"
archive="bookflip.jar"
height="120" width="120">
<param name="res" value="1" />
<param name="image1" value="01.jpg" />
<param name="link1" value="NO" />
<param name="flip1" value="0" />
<param name="image2" value="02.jpg" />
<param name="link2" value="NO" />
<param name="flip2" value="0" />
<param name="speed" value="4" />
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" height="120" width="120" >
<param name="code" value="bookflip" />
<param name="archive" value="bookflip.jar" />
<param name="res" value="1" />
 
Search WWH ::




Custom Search