December 2006
Intermediate to advanced
514 pages
12h 37m
English
The JavaScript in Figure 14-4 used Ajax to read the contents of a file called sample.txt, but it did not display the contents of the file. Your assignment is to write a page that asks for a file to read in, and then displays the contents of that file in a div. Figure 14-7 depicts how a solution might look after a user entered sample.txt into the text field and clicked the Get the File button. Remember, the file that Ajax reads must live in the same directory as one that contains the Ajax code.

Figure 14-7. Displaying the contents of a file
Read now
Unlock full access