Section 2.2. Running the Example


2.2. Running the Example

If you download the code for this example from this book's web site (http://www.oreilly.com/catalog/9780596101879), you can simply copy the files from the ch02 directory. Some developers prefer to hand-type the example code, which does help solidify the examples in one's mind.

To run the example:

  1. Save the HTML code from Example 2-1 in a file called index.html.

  2. Save the JavaScript from Example 2-2 in a file called ajax.js in the same directory.

  3. Save the CSS code from Example 2-3 in a file called style.css in the same directory.

  4. Open index.html with a browser; you should see something similar to Figure 2-1.

Figure 2-1. The Ajax Character Decoder running in Internet Explorer


When you press a key, the key will show up in the "Key Pressed:" field and the input field will be cleared. Since the server isn't implemented yet, you won't see the decimal value. In the next chapter, we'll hook up a servlet that populates the Decimal field.




Ajax on Java
Ajax on Java
ISBN: 0596101872
EAN: 2147483647
Year: 2007
Pages: 78

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