Information Technology Reference
In-Depth Information
We're now using jQuery.parseJSON to parse the text we get back from
our XMLHttpRequest.
And we've got an HTML formatted list that will be displayed once
we've retrieved the JSON.
The finished product looks like this in our browser (Figure 12-14):
Figure 12-14. The My News application
And when we click on “Get the news!” the following is displayed (Figure 12-15):
Figure 12-15. The news is now loaded!
Now that we've loaded data from our server, and loaded data from a web service, we
can turn to the final installment: a back-and-forth interaction between a web page and a
database.
Username Availability
One of the nicer things that websites have done in the last few years is the “instant
username availability” field. This is done using AJAX, by checking what the user is
entering into the “username” field and simultaneously checking on its availability in the
database. We'll create this experience using AJAX, communicating with a MySQL
database using PHP on the back-end. This is similar to what Google does with its
 
Search WWH ::




Custom Search