HTML5 Developer's Cookbook by Chuck Hudson | WHSmith Books
HTML5 Developer's Cookbook

HTML5 Developer's Cookbook

By: Chuck Hudson (author), Tom Leadbetter (author)Paperback

Up to 2 WeeksUsually despatched within 2 weeks

£28.49 RRP £29.99  You save £1.50 (5%) With FREE Saver Delivery

Description

2012 Jolt Productivity Award winner! Using HTML5, web developers can create standards-based browser applications with extraordinary richness and power, incorporating everything from drag-and-drop to native audio and video-all without any third-party plug-ins. Simply put, every web developer needs to master HTML5-and the sooner you do so, the greater advantage you'll have. HTML5 Developer's Cookbook provides all the expert advice and proven code you need to start building production-quality HTML5 applications right now. Authors Chuck Hudson and Tom Leadbetter present tested, modular recipes at beginner, intermediate, and advanced levels. You'll learn exactly how to deliver state-of-the-art user experiences by integrating HTML5's new and enhanced elements with CSS3, multimedia, and JavaScript APIs. Reflecting current standards, this book prioritizes HTML5 features with substantial browser support and identifies the level of browser support for each feature discussed. Coverage includes Understanding and using HTML5's new structural elements Using grouping, text-level, and redefined semantics Managing browser-handling in HTML5 Leveraging new CSS3 layout and style techniques Maximizing interactivity with HTML5 Web Forms Embedding audio and video with HTML5 Drawing with the canvas Controlling browser histories Integrating location awareness with the Geolocation API Implementing client side storage Working with local files Managing communication and threading Optimizing the HTML5 browser experience Integrating device data Turn to HTML5 Developer's Cookbook for expert answers, real solutions, and the code required to implement them. It's all you need to jumpstart any HTML5 project and create rich, high-value web applications your users will love.

About Author

Chuck Hudson has developed mobile web and mobile solutions since the 1990s. A successful "techpreneur" and long-time geek-in-training, he is a certified PHP programmer and PayPal developer. He teaches web programming, mobile technology, and entrepreneurship throughout the Boston and Atlanta regions. In 2008, he received the eBay Star Developer award for the first iPhone mobile web and native apps. Tom Leadbetter is a web designer and developer based in Liverpool, England. He has been working with HTML5 since early 2009 and blogs about it at HTML5Doctor.com.

Contents

Introduction xix Acknowledgments xxviiAbout the Authors xxix Chapter 1: New Structural Elements in HTML5 1BEGINNER RECIPE: Building an HTML5 Starter Document 2Where Do All the New Elements Come From? 4BEGINNER RECIPE: Using the header Element to Create a Site Header 5BEGINNER RECIPE: Using the hgroup Element to Group Headings 7BEGINNER RECIPE: Creating Navigation with the nav Element 8INTERMEDIATE RECIPE: Using the New article Element 11INTERMEDIATE RECIPE: Grouping Content with the section Element 12BEGINNER RECIPE: Creating a Sidebar with the aside Element 15BEGINNER RECIPE: Using the footer Element 17INTERMEDIATE RECIPE: Using the HTML5 Outliner to Ensure the Correct Structure 19ADVANCED RECIPE: Using All the New Elements to Build a News Page 21ADVANCED RECIPE: Using All the New Elements to Build a Search Results Page 25Summary 30 Chapter 2: Grouping, Text-Level, and Redefined Semantics 31BEGINNER RECIPE: Marking Up Figures and Captions with the figure and figcaption Elements 31BEGINNER RECIPE: Marking Up the Date and Time with the time Element 34BEGINNER RECIPE: Making a Native Toggle Widget with the details Element 35BEGINNER RECIPE: Using the address Element for Contact Information 37BEGINNER RECIPE: Highlighting Text with the mark Element 38BEGINNER RECIPE: Using the s Element to Show Inaccurate or Irrelevant Content 39Changes to Existing Elements 39BEGINNER RECIPE: Wrapping Links Around Elements 47INTERMEDIATE RECIPE: Adding Semantic Information with Microdata 47INTERMEDIATE RECIPE: Using WAI-ARIA with HTML5 49ADVANCED RECIPE: Marking Up an Article Page with Comments 51Summary 54 Chapter 3: Browser Handling in HTML5 55BEGINNER RECIPE: Dealing with Internet Explorer 55Boilerplates 57BEGINNER RECIPE: Testing for HTML5 Features 57INTERMEDIATE RECIPE: Leveraging jQuery to Replace a Calendar 59INTERMEDIATE RECIPE: Using Modernizr to Detect Features 62Polyfilling 66Useful HTML5 Verification Sites 67Summary 67 Chapter 4: New Layout and Style Techniques with CSS3 69INTERMEDIATE RECIPE: Creating a Responsive Design with CSS3 Media Queries 69BEGINNER RECIPE: Using Custom Fonts with @font-face 77INTERMEDIATE RECIPE: Making Buttons with CSS Gradients and Multiple Backgrounds 80INTERMEDIATE RECIPE: Enhancing a Site with Transformations and Transitions 84ADVANCED RECIPE: Creating Animations with CSS 89Summary 94 Chapter 5: HTML5 Web Forms 95Validation 95HTML 4 Input Types 95BEGINNER RECIPE: Creating a Form to Collect Contact Information 97BEGINNER RECIPE: Creating a Search Form with input type="search" 101BEGINNER RECIPE: Creating Calendar and Time Controls 102BEGINNER RECIPE: Creating a Number Picker 105BEGINNER RECIPE: Creating a Slider (Without the Need for JavaScript) 106BEGINNER RECIPE: Creating a Color Picker 107BEGINNER RECIPE: Displaying Results with the output Element 108BEGINNER RECIPE: Using Form Placeholder Text 109BEGINNER RECIPE: Creating an Autocomplete Feature with list and datalist 110BEGINNER RECIPE: Tracking the Completion of a Task with the progress Element 111BEGINNER RECIPE: Measuring with the meter Element 112BEGINNER RECIPE: Jumping to a form Element When the Page Loads 114BEGINNER RECIPE: Allowing Multiple Entries 115BEGINNER RECIPE: Basic Validation with the required Attribute 116INTERMEDIATE RECIPE: Writing Your Own Validation Rule 117BEGINNER RECIPE: Limiting User Input 118INTERMEDIATE RECIPE: Customizing and Styling the Form 119Error Messages 121ADVANCED RECIPE: Putting It All Together to Make a Sign-Up Form 121Summary 125 Chapter 6: Drawing with Canvas 127Canvas Overview 127BEGINNER RECIPE: Laying a Grid on the Canvas 130Canvas Tools 134BEGINNER RECIPE: Making Simple Shapes and Lines 134INTERMEDIATE RECIPE: Drawing Polygons with a Path 139INTERMEDIATE RECIPE: Drawing Arcs and Circles 143BEGINNER RECIPE: Adding Text 144BEGINNER RECIPE: Drawing an Image 145INTERMEDIATE RECIPE: Cropping an Image 146INTERMEDIATE RECIPE: Animating a Sprite Map 147Canvas Transformations 150ADVANCED RECIPE: Animating an Image 151ADVANCED RECIPE: Animating a Vertical Bar Chart 155Summary 162 Chapter 7: Embedding Video with HTML5 163BEGINNER RECIPE: Including Video with the video Element 163INTERMEDIATE RECIPE: Enabling Video for All Browsers 166INTERMEDIATE RECIPE: Creating a Video with Subtitles and Captions 173The Media API 177ADVANCED RECIPE: Making Your Own Custom Controls 178Summary 186 Chapter 8: Embedding Audio with HTML5 187BEGINNER RECIPE: Including Audio with the audio Element 187INTERMEDIATE RECIPE: Enabling Audio for All Browsers 188New Audio Attributes 190The Media API 192INTERMEDIATE RECIPE: Creating a Beat Mixer 193ADVANCED RECIPE: Adding Streaming Radio 197Summary 206 Chapter 9: Changing Browser History 207History Basics 207BEGINNER RECIPE: Adding to History with pushState 208BEGINNER RECIPE: Creating an Image Viewer 211INTERMEDIATE RECIPE: Popping State in the Image Viewer 214BEGINNER RECIPE: Changing History with replaceState 216INTERMEDIATE RECIPE: Changing the Page History 218ADVANCED RECIPE: Using Advanced State Data Objects to Pass Information Across Pages 221INTERMEDIATE RECIPE: Testing History Security 225Helpful Libraries 228Summary 228 Chapter 10: Location Awareness with the Geolocation API 231Geolocation Overview 231BEGINNER RECIPE: Determining Your Location with a Simple getCurrentPosition 233INTERMEDIATE RECIPE: Mapping a Location with getCurrentPosition 237INTERMEDIATE RECIPE: Determining Distance with PositionOptions 243ADVANCED RECIPE: Following a Moving Location with watchPosition 250Summary 257 Chapter 11: Client-Side Storage 259Client-Side Storage Overview 259BEGINNER RECIPE: Getting and Setting Session Storage 263BEGINNER RECIPE: Styling from Session Storage 266INTERMEDIATE RECIPE: Storing Forms with Local Storage 271ADVANCED RECIPE: Catching Events in Local Storage 275Web SQL Database API 283ADVANCED RECIPE: Using a Web Database for a Grocery List 286Summary 295 Chapter 12: Communication and Threading 297WebSocket API Overview 297BEGINNER RECIPE: Talking Through Web Sockets 299Threading Through Web Workers 302BEGINNER RECIPE: Creating a Web Worker 304INTERMEDIATE RECIPE: Adding Two-Way Communication 308ADVANCED RECIPE: Leveraging a Shared Web Worker 311Summary 318 Chapter 13: Browser Experience in HTML5 319Drag and Drop API 319BEGINNER RECIPE: Dragging and Dropping Across divs 321ADVANCED RECIPE: Leveraging Events and dataTransfer 325Application Cache and API 334BEGINNER RECIPE: Creating a Manifest File 335BEGINNER RECIPE: Using Web Pages Offline 337Application Cache API 340Notification API 341BEGINNER RECIPE: Displaying a Simple Notification 344ADVANCED RECIPE: Creating a Tweet Notification Page 348Summary 357 Chapter 14: Working with Local Files 359File API Overview 359BEGINNER RECIPE: Getting File Attributes 360BEGINNER RECIPE: Processing Multiple Files with Drag and Drop 362The FileReader Interface 367INTERMEDIATE RECIPE: Previewing Images Through readAsDataURL 368ADVANCED RECIPE: Parsing a CSV File with readAsText 373File API Extended Specifications 381ADVANCED RECIPE: Creating a Local File 382Summary 388 Chapter 15: Integrating Device Data 389Brief Device APIs History 389Contacts API 391BEGINNER RECIPE: Retrieving All Contacts and Mobile Numbers 393Messaging API 396Network Information API 397Battery Status Events 398HTML Media Capture 398INTERMEDIATE RECIPE: Capturing Pictures with File Input 399Device Orientation and Motion Events 403INTERMEDIATE RECIPE: Creating a Bubble Level 404Summary 409 Recipes 411 Index 415

Product Details

  • ISBN13: 9780321769381
  • Format: Paperback
  • Number Of Pages: 480
  • ID: 9780321769381
  • weight: 728
  • ISBN10: 0321769384

Delivery Information

  • Saver Delivery: Yes
  • 1st Class Delivery: Yes
  • Courier Delivery: Yes
  • Store Delivery: Yes

Prices are for internet purchases only. Prices and availability in WHSmith Stores may vary significantly

Close