JavaScript Text, Chapter 12 (Updating Web Pages with Ajax), pgs 577 - 613.
FYI: Interesting AJAX websites. Not required reading:
-
Traditional event registration model
On page 611 notice step 4 says
httpRequest.onreadystatechnage=fillNewsInfo;
This is registering the function to the event handler the entire function (not just a call, the
function is now associated with the event.
-
What is the difference between asynchronous (AJAX) and synchronous request?
“AJAX is an asynchronous technology where others request are synchronous.”
On page 610, step 2, httpRequest.readyState==4
value 4 - meaning the load is complete
value 200 - means success
- HTTP Header Viewer: list browser headers
When your browser requests a web page from a server via HTTP, it sends a set of headers with various
bits of information about itself.
Page 594, step 4, you are only sending Content-Type, Content-Length, and Cache-Control.
Reading:
- Publisher provided documents and images
- If you haven't already downloaded the student files from the publishers site, do so now.
- You will need to upload your pages to test your AJAX and PHP code.
- The text includes instructions on setting up your computer as a web server. If you choose to
do this, I can't help you with that.
Practice:
- topStories.htm
- Create the document on pages 580 - 582 and save as topStories1.htm in your assignment10 folder.
- Create the PHP script on pages 593 - 594 and save as TopStories.php in your assignment10 folder. Stop at step 6.
Here is an example of those 2 pages running. Top Stories 1
- Save topStories1.htm as topStories2.htm. Add the coding on page 599 to your topStories2.htm page.
Here is an example of the page 599 upate. Top Stories 2 (Multiple Browsers)
- Save topStories2.htm as topStories3.htm. Add Save the coding on pages 601 - 602 to your topStories3.htm page.
- Save topStories3.htm as topStories4.htm. Modify your topStories.htm4 page with the steps on pages 606-607. Once uploaded
your page should resemble the examples in Figure 12-9 and Figure 12-10.
- Save topStories4.htm as topStories5.htm. Modify your topStories5.htm page with the steps on pages 610-611.
- Save topStories5.htm as topStories6.htm. Add the coding on page 613 to your topStories6.htm page.
Case Project:
- No case project for this assignment.
Update your index page:
- Add links on your index page to the pages in your assignment10 folder that are to be graded:
Uploading:
- Upload your revised index.htm page to the public_html folder.
- Upload your assignment10 folder with the files:
- topStories6.htm
- TopStories.php
Testing uploaded pages
- Depending on how quickly your RSS feed downloads, you might experience a "flicker" or a data not found.
- Follow the checklist for grading shown on
the schedule page.
- Make any corrections for any page that does not validate or display correctly.