O'Reilly logo

HTML5 Web Application Development By Example Beginner's guide by J.M. Gustafson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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"></span><br/> Humidity: <span data-field="relative_humidity"></span><br/> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required