IN THIS CHAPTER
- Storing your data in variables and arrays
- Making decisions with the if statement
- Looping with the for and while loops
This example downloads and displays text from a server. (You'll see what makes it tick in detail in the next chapter.) You can see this example in a Web browser in Figure 2.1.
When this application is hosted on a Web server, clicking the Fetch the Message button causes the application to use Ajax techniques behind the scenes to connect to the server and download the contents of a text file, data.txt. Here's what's in data.txt:
This text was fetched from the server with Ajax.
Clicking the button downloads the message from the server, without any page refresh needed. The downloaded ...