Time for action – creating a weather widget
Throughout this chapter we will demonstrate how to make various Ajax calls by implementing a widget that shows a weather report. Let's start by defining the widget's HTML markup:
<div id="weather-widget"> <div class="loading"> <p>Checking the weather...</p> <img src="images/loading.gif" alt="Loading..."/> </div> <div class="results"> <header> <img src="" alt="Condition"/>Current weather for <div class="location"><span></span></div> </header> <section class="conditions"> Conditions: <span data-field="weather"></span><br/> Temperature: <span data-field="temperature_string"></span><br/> Feels Like: <span data-field="feelslike_string"...