HTML5 APPLICATIONS DEVELOPMENT MANUAL
...
33 - Accessing Device and Operating System Resources The Windows Runtime environment enables developers to access in- memory res ...
} Refresh or Reopen the file sessionStorage Changing each instance of localStorage to sessionStorage. ...
<!doctype html> localStorage Example function load() { var value = sessionStorage.getItem("myKey"); if (!value) { alert ...
Close page and reopen: Accessing Hardware Capabilities Building with HTML5, CSS, and JavaScript leads to device- independent app ...
34 - Bootstrap Responsive web design is about creating web sites which automatically adjust themselves to look good on all devic ...
MaxCDN provides CDN support for Bootstrap's CSS and JavaScript. You must also include jQuery. <link rel="stylesheet" href="h ...
35 – Weather application development Let’s create an application that will show the weather at the user's current location. Ther ...
On the right at the page we can see, that we can access the current weather data of one location, after geographic coordinates. ...
In the API keys tab you will find your unique key for this API. Let's build a container for our application first. Let’s create ...
Let’s add a background to the page. I’m using a free pattern that I downloaded from google, and let’s style the container. We ha ...
We will use javascript to build our app, so we will create an external javascript file, in the same location with the name javas ...
Developers tab, we have a section for jQuery, to get the user’s geolocation. If we run our app in the browser, on the Inspect el ...
Now that we have that call all set, the data logged, we want to take this outside of the call function. Remember that this beein ...
Let’s replace the lat, lon and the appid, each one of you with his own current location coordinates, and his own API key. I am r ...
Let’s make now the call to the weather api using a$.getJSON().Inside of the parenthesis we will put the url till before our uniq ...
Now that we have this call, let’s add our function, let’s call it wd from weather data, and get it with a console.log. We can se ...
Same logic for : var currentWeather = wd.weather[0].description; We have an array from the first element, the description. For t ...
So now we have in our script: Let’s go now on the html file. Let’s say we want to display in our container, first, the location. ...
So now we have on our app the location: We will do the same for the temperature and the weater description. Let’s create Then ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf