Head First JavaScript Code: Chapter 12, Dynamic Data
The modern Web is a very responsive place where pages are expected to react to the user's every whim.
Or at least that's the dream of many Web users and developers. JavaScript plays a vital role in this dream through a programming technique known as Ajax that provides a mechanism for dramatically changing the "feel" of Web pages. With Ajax, Web pages act much more like full-blown applications since they are able to quickly load and save data dynamically while responding to the user in real time without any page refreshes or browser trickery.
Download the Code
Code Description and Viewing
YouCube
The YouCube web page from Chapter 10 is continued here. However, there is only one new version of the page, youcube13.html, which corresponds to the completed YouCube application. This version of the YouCube page ONLY works when opened from a real Web server. It WON'T work when opened directly from your local hard disk because Ajax requests require a web server.
- youcube13.html - YouCube web page with support for reading and writing blog entries from/to an XML file using Ajax (page 594)
- youcubeadd.html - YouCube blog entry addition web page used to add blog entries through a web interface (page 588)
- ajax.js - External JavaScript code to help in carrying out Ajax requests (page 558)
- date.js - External JavaScript code to help in formatting dates (page 592)
- addblogentry.php - PHP server script that processes blog entry additions for the YouCube blog entry addition web page (page 580)
- blog.xml - XML file containing YouCube blog entries
- wait.gif - Animated "wait" image that appears on the YouCube web page while an Ajax request is being carried out
- cube.png - Cube image that appears on the YouCube web page
- cube777.png - Seven-sided cube image used in a YouCube blog entry
- cubeapart.png - Disassembled cube image used in a YouCube blog entry






