Servage Magazine

Information about YOUR hosting company – where we give you a clear picture of what we think and do!

New elements and attributes in HTML5 – Part 2

Thursday, December 26th, 2013 by Servage

Here we discuss a few more new elements and attributes that are introduced on HTML5 recently.
Canvas API
The canvas element adds a dynamic, two-dimensional drawing space to a page. We’ll take a look at it at the end of this chapter.
Web Storage API
Allows data to be stored in the browser’s cache so that an application can use it later. Traditionally, that has been done with “cookies,” but the Web Storage API allows more data to be stored. It also controls whether the data is limited to one session (session Storage: when the window is closed, the data is cleared) or based on domain (local Storage: all open windows pointed to that domain have access to the data).
Geolocation API
Lets users share their geographical location (longitude and latitude) so that it is accessible to scripts in a web application. This allows the app to provide location-aware features such as suggesting a nearby restaurant or finding other users in your area.
Offline Web Application API
Makes it possible for a web application to work even when there is no Internet connection. It does it by including a manifest document that lists all of the files and resources that should be downloaded into the browser’s cache in order for the application to work. When a connection is available, it checks to see whether any of the documents have changed, then updates those documents.
Web Workers API
Provides a way to run computationally complicated scripts in the background. This allows the browser to keep the web page interface quick and responsive to user actions while working on processor-intensive scripts at the same time. The Web Workers API is part of the HTML5 spec at the WHATWG, but at the W3C, it’s been moved into a separate document.
Web Sockets API
Creates a “socket,” which is an open connection between the browser client and the server. This allows information to flow between the client and the server in real time, with no lags for the traditional HTTP requests. It is useful for multiplayer games, chat, or data streams that update constantly, such as sports or stock tickers or social media streams.

Some APIs have correlating HTML elements, such as the audio and video elements for embedding media players on a page, and the canvas element for adding a dynamic drawing area.

Apple’s announcement that it would not support Flash on its iOS devices, ever, gave HTML5 an enormous push forward and eventually led to Adobe stopping development on its mobile Flash products. Not long after, Microsoft announced that it was discontinuing its Silverlight media player in lieu of HTML5 alternatives. As of this writing, HTML5 is a long way from being able to reproduce the vast features and functionality of Flash, but it’s getting there gradually. That means we are likely to see Flash and Silverlight players on the desktop for years to come, but the trajectory away from plug-ins and toward web standards technologies seems clear.

Resources and further reading

W3 Schools

HTML Goodies

New elements and attributes in HTML5 - Part 2, 5.0 out of 5 based on 3 ratings
Categories: Guides & Tutorials

Keywords:

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

No comments yet (leave a comment)

You are welcome to initiate a conversation about this blog entry.

Leave a comment

You must be logged in to post a comment.