Chapter 8. A Change in the Weather
"Climate is what we expect, weather is what we get."
– Mark Twain
In this chapter, we will build a weather widget to learn about using Ajax to load content asynchronously and communicate with web services. We will learn about Ajax and how to use jQuery's Ajax methods to load files that contain XML or JSON formatted data. Then we will get the weather conditions from a web service to display in the widget. We will also use the HTML Geolocation API to find the user's location so we can show their local weather.
We will learn the following in this chapter:
- How to get XML and JSON data using jQuery' Ajax methods
- Parsing JSON versus XML returned from services
- What web services are and how to communicate with them asynchronously using Ajax
- The problem with cross site scripting, and the solution JSONP
- How to use HTML5 Geolocation API to get the user&apos...