Sandeep Panda is a web developer and writer with a passion for JavaScript and HTML5. He has over four years' experience programming for the Web. He loves experimenting with new technologies as they emerge and is a continuous learner. While not programming, Sandeep can be found playing games and listening to music.
About SitePoint
SitePoint specializes in publishing fun, practical, and easy-to-understand content for web professionals. Visit http://www.sitepoint.com/ to access our blogs, books, newsletters, articles, and community forums. Youll find a stack of information on JavaScript, PHP, Ruby, mobile development, design, and more.
About Jump Start
Jump Start books provide you with a rapid and practical introduction to web development languages and technologies. Typically around 150 pages in length, they can be read in a weekend, giving you a solid grounding in the topic and the confidence to experiment on your own.
Preface
HTML (HyperText Markup Language) is the predominant language of web pages. Whenever you read or interact with a page in your browser, chances are its an HTML document. Originally developed as a way to describe and share scientific papers, HTML is now used to mark up all sorts of documents and create visual interfaces for browser-based software.
With HTML5, however, HTML has become as much an of API (Application Processing Interface) for developing browser-based software as it is a markup language. In this book, well talk about the history of HTML and HTML5 and explore some of its new features.
HTML5 also improves existing elements. With its new input types, we can create rich form controls without the need for a JavaScript library. For example, if you want a slider input control, you can use . Input types such as email
and url
add client-side validation to the mix. New audio
and video
elements let us embed audio and video media directly in our documents. Both elements also have scripting interfaces that we can use to create custom media players or clever visual effects. And we can do this without the need for a plugin in supporting browsers.
We can draw in HTML5 with the addition of the canvas
element and support for inline Scalable Vector Graphics (or SVG). The canvas
element is a powerful bitmap drawing API that lets us create 2D or 3D images, charts, and games. SVG, on the other hand, uses vector graphics to create reusable, scalable, scriptable images that work across devices and screens.
Perhaps the biggest shift of HTML5 is this: APIs that are part of HTML's document object model, but don't have corresponding markup elements. They are purely DOM APIs that we can use with JavaScript to share and consume data, or create location-aware applications. Web Workers, mimics multi-threaded JavaScript and background tasks. The Geolocation API lets our apps take location into context. With cross-document messaging, we can send data between documents, even across domains, without exposing the full DOM of either. Finally, Server-Sent Events and WebSockets enable near-real time communication between client and server.
After reading this book, you'll know the basics of everything mentioned above, and be well on your way to developing amazing HTML5 websites and applications.
Who Should Read This Book
Although this book is meant for HTML5 beginners, it isn't totally comprehensive. As a result, we do assume some prior knowledge of HTML. If you are completely new to web development, SitePoints Build Your Own Website Using HTML and CSS may be a better book for you.
As we progress through the book, we'll tackle some more advanced topics, such as APIs and offline applications. To follow these sections, you should be familiar with HTML and the fundamentals of JavaScript and the Document Object Model (DOM). Its unnecessary to have deep knowledge of JavaScript. Still, you should understand event handling, JavaScript data types, and control structures such as