Intro, Chapter 1
I have finally received the Head Rush Ajax book and have begun reading the book.
The introduction discusses their teaching paradigm. It basically consists of lots of pictures and words within the pictures. They claim that the brain is most engaged when it sees words within pictures. We'll see how effective that is by the end of the book.
The chapter begins with the reason why Ajax would be useful for certain webpages. It brings in the example of Boards 'R' Us. It's a PHP site that shows the number of snowboards that are sold, price and cost of snowboards, and net revenue. There are a couple fields on the page that update and a couple fields that do not update. But the whole page refreshes. Through this example, the book begins the process of adding Ajax to the site. There are three major steps outlined as follows:
1.) Creating a request object.
2.) Requesting updated sales.
3.) Coding updatePage().
Creating a request object
It provides a pre-assembled javascript code to add to the HTML page.
Requesting updated sales
After creaing a request, the next step is to write the getBoardsSold() function. This function will use the new object to request the total number of boards sold from the server. To get this function to work, you'll need to do four things:
a.) Create a new request object by calling the createRequest() function
b.) Figure out what URL you need to connect to so you can get updated board sales
c.) Set up the request object to make a connection
d.) Request an updated number of boards sold
Coding updatePage()
This part is getting the server's response and updating the fields with new numbers.
The introduction discusses their teaching paradigm. It basically consists of lots of pictures and words within the pictures. They claim that the brain is most engaged when it sees words within pictures. We'll see how effective that is by the end of the book.
The chapter begins with the reason why Ajax would be useful for certain webpages. It brings in the example of Boards 'R' Us. It's a PHP site that shows the number of snowboards that are sold, price and cost of snowboards, and net revenue. There are a couple fields on the page that update and a couple fields that do not update. But the whole page refreshes. Through this example, the book begins the process of adding Ajax to the site. There are three major steps outlined as follows:
1.) Creating a request object.
2.) Requesting updated sales.
3.) Coding updatePage().
Creating a request object
It provides a pre-assembled javascript code to add to the HTML page.
Requesting updated sales
After creaing a request, the next step is to write the getBoardsSold() function. This function will use the new object to request the total number of boards sold from the server. To get this function to work, you'll need to do four things:
a.) Create a new request object by calling the createRequest() function
b.) Figure out what URL you need to connect to so you can get updated board sales
c.) Set up the request object to make a connection
d.) Request an updated number of boards sold
Coding updatePage()
This part is getting the server's response and updating the fields with new numbers.




