Htlml5

 

Embed or link this publication

Popular Pages


p. 1

the expert s voice ® in web development pro html5 programming powerful apis for richer internet application development use html5 to create cutting-edge web applications peter lubbers brian albers and frank salim foreword by paul irish google

[close]

p. 2

download from wow ebook

[close]

p. 3

pro html5 programming powerful apis for richer internet application development peter lubbers brian albers frank salim

[close]

p. 4

pro html5 programming powerful apis for richer internet application development copyright © 2010 by peter lubbers brian albers frank salim all rights reserved no part of this work may be reproduced or transmitted in any form or by any means electronic or mechanical including photocopying recording or by any information storage or retrieval system without the prior written permission of the copyright owner and the publisher isbn-13 pbk 978-1-4302-2790-8 isbn-13 electronic 978-1-4302-2791-5 printed and bound in the united states of america 9 8 7 6 5 4 3 2 1 trademarked names logos and images may appear in this book rather than use a trademark symbol with every occurrence of a trademarked name logo or image we use the names logos and images only in an editorial fashion and to the benefit of the trademark owner with no intention of infringement of the trademark the use in this publication of trade names trademarks service marks and similar terms even if they are not identified as such is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights president and publisher paul manning lead editor clay andres development editor matthew moodie technical reviewer paul haine editorial board clay andres steve anglin mark beckner ewan buckingham gary cornell jonathan gennick jonathan hassell michelle lowman matthew moodie duncan parkes jeffrey pepper frank pohlmann douglas pundick ben renow-clarke dominic shakeshaft matt wade tom welsh coordinating editor laurin becker copy editors heather lang andy rosenthal nancy sixsmith compositor kimberly burton indexer julie grady artist april milne cover designer anna ishchenko distributed to the book trade worldwide by springer science+business media llc 233 spring street 6th floor new york ny 10013 phone 1-800-springer fax 201 348-4505 e-mail orders-ny@springer-sbm.com or visit www.springeronline.com for information on translations please e-mail rights@apress.com or visit www.apress.com apress and friends of ed books may be purchased in bulk for academic corporate or promotional use ebook versions and licenses are also available for most titles for more information reference our special bulk sales­ebook licensing web page at www.apress.com/info/bulksales the information in this book is distributed on an as is basis without warranty although every precaution has been taken in the preparation of this work neither the authors nor apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work the source code for this book is available to readers at www.prohtml5.com and also at www.apress.com ii

[close]

p. 5

for my beautiful wife vittoria and for my sons sean and rocky i am so proud of you peter lubbers for john you make it all worthwhile brian albers for people who still read books frank salim

[close]

p. 6

contents at a glance foreword xiii about the authors xiv about the technical reviewer xv acknowledgements xvi introduction xvii chapter 1 overview of html5 1 chapter 2 using the html5 canvas api 25 chapter 3 working with html5 audio and video 65 chapter 4 using the html5 geolocation api 87 chapter 5 using the communication apis 115 chapter 6 using the html5 websocket api 137 chapter 7 using the html5 forms api 169 chapter 8 using the html5 web workers api 193 chapter 9 using the html5 web storage api 213 chapter 10 creating html5 offline web applications 243 chapter 11 the future of html5 259 index 269 iv

[close]

p. 7

contents foreword xiii about the authors xiv about the technical reviewer xv acknowledgements xvi introduction xvii chapter 1 overview of html5 1 the story so far the history of html5 1 the myth of 2022 and why it doesn t matter 2 who is developing html5 3 a new vision 3 compatibility and paving the cow paths 3 utility and the priority of constituencies 4 interoperability simplification 5 universal access 5 a plugin­free paradigm 5 what s in and what s out 6 what s new in html5 8 new doctype and character set 8 new and deprecated elements 9 semantic markup 10 simplifying selection using the selectors api 17 javascript logging and debugging 20 window.json 21 v

[close]

p. 8

contents dom level 3 22 monkeys squirrelfish and other speedy oddities 22 summary 23 chapter 2 using the html5 canvas api 25 overview of html5 canvas 25 history 25 what is a canvas 26 canvas coordinates 26 when not to use canvas 27 fallback content 27 css and canvas 28 browser support for html5 canvas 28 using the html5 canvas apis 29 checking for browser support 29 adding a canvas to a page 30 applying transformations to drawings 32 working with paths 35 working with stroke styles 38 working with fill styles 39 filling rectangular content 40 drawing curves 42 inserting images into a canvas 44 using gradients 45 using background patterns 47 scaling canvas objects 49 using canvas transforms 52 using canvas text 53 applying shadows 55 working with pixel data 57 vi

[close]

p. 9

contents implementing canvas security 58 building an application with html5 canvas 59 practical extra full page glass pane 63 summary 63 chapter 3 working with html5 audio and video 65 overview of html5 audio and video 65 video containers 65 audio and video codecs 67 audio and video restrictions 68 browser support for html5 audio and video 68 using the html5 audio and video apis 69 checking for browser support 70 understanding media elements 71 working with audio 76 working with video 77 practical extras 84 summary 86 chapter 4 using the html5 geolocation api 87 about location information 87 latitude and longitude coordinates 88 where does location information come from 88 ip address geolocation data 89 gps geolocation data 89 wi-fi geolocation data 90 cell phone geolocation data 90 user­defined geolocation data 91 browser support for html5 geolocation 91 privacy 92 vii

[close]

p. 10

contents triggering the privacy protection mechanism 93 dealing with location information 95 using the html5 geolocation api 95 checking for browser support 95 position requests 96 building a real-time application with html5 geolocation 101 writing the html display 104 processing the geolocation data 104 the final code 108 practical extras 111 what s my status 111 show me on a google map 113 summary 114 chapter 5 using the communication apis 115 cross document messaging 115 understanding origin security 117 browser support for cross document messaging 118 using the postmessage api 119 building an application using the postmessage api 120 xmlhttprequest level 2 126 cross-origin xmlhttprequest 126 progress events 128 browser support for html5 xmlhttprequest level 2 129 using the xmlhttprequest api 129 building an application using xmlhttprequest 131 practical extras 135 structured data 135 framebusting 135 viii

[close]

p. 11

contents summary 136 chapter 6 using the html5 websocket api 137 overview of html5 websockets 137 real-time and http 137 understanding html5 websockets 139 browser support for html5 websockets 146 writing a simple echo websocket server 146 using the html5 websocket api 154 checking for browser support 154 basic api usage 155 building an application with html5 websockets 158 coding the html file 159 adding the websocket code 161 adding the geolocation code 162 putting it all together 162 the final code 164 summary 167 chapter 7 using the html5 forms api 169 overview of html5 forms 169 html forms vs xforms 170 functional forms 170 browser support for html5 forms 170 an input catalog 171 using the html5 forms apis 176 new form attributes and functions 176 checking forms with validation 180 validation feedback 184 building an application with html5 forms 185 ix

[close]

p. 12

contents practical extras 190 summary 191 chapter 8 using the html5 web workers api 193 browser support for html5 web workers 194 using the html5 web workers api 194 checking for browser support 194 creating html5 web workers 195 loading and executing additional javascript 195 communicating with html5 web workers 195 coding the main page 196 download from wow ebook

[close]

p. 13

contents setting and retrieving values 216 plugging data leaks 217 local versus session storage 219 other web storage api attributes and functions 219 communicating web storage updates 221 exploring web storage 223 building an application with html5 web storage 224 the future of browser database storage 235 practical extras 238 json object storage 238 a window into sharing 239 summary 241 chapter 10 creating html5 offline web applications 243 overview of html5 offline web applications 243 browser support for html5 offline web applications 245 using the html5 offline web application api 246 checking for browser support 246 creating a simple offline application 246 going offline 247 manifest files 247 the applicationcache api 248 building an application with html5 offline web applications 250 creating a manifest file for the application resources 251 creating the html structure and css of the ui 252 creating the offline javascript 252 check for applicationcache support 254 adding the update button handler 255 add geolocation tracking code 255 xi

[close]

p. 14

contents adding storage code 256 adding offline event handling 256 summary 257 chapter 11 the future of html5 259 browser support for html5 259 html evolves 259 webgl 260 devices 262 audio data api 263 video improvements 263 touchscreen device events 263 peer-to-peer networking 266 ultimate direction 267 summary 267 index 269 xii

[close]

p. 15

foreword in june 2004 representatives from the semantic web community major browser vendors and the w3c met in san jose california to discuss the standards body s response to the rise of web applications at the end of the second day a vote was held to decide whether the w3c should augment html and the dom to address the new requirements of web applications minutes from the event record the anonymous and curious result 8 for 14 against this schism lead to a divergence in effort two days later the whatwg was formed from the major browser vendors to solve emerging issues meanwhile the w3c pushed forward with the xhtml2 specification only to drop it five years later to focus on an aligned html5 effort with the whatwg now six years since we stand to benefit greatly from the passionate minds that have designed html5 the features both codify de facto standards that have been in use for years and lay the groundwork for next-generation web applications putting them to use means a more engaging and responsive web experience for your users and oftentimes far less code for you in this book you ll find a well-designed learning curve bringing you up to speed on the features within html5 and its associated specifications you ll learn best practices of feature detection appropriate use cases and a lot of the whys that you won t find in the specifications the code examples are not plain trivial uses of each api but instead lead you through building actual web applications i hope this book is able to serve you well and i hope you ll be as excited about the next generation of the web as i am paul irish google and jquery dev relations and lead developer for modernizr xiii

[close]

Comments

no comments yet

YOUBLISHER
About
What Others Say
Sitemap
Impressum

PUBLISHERS
Login
Signup
Tutorials
FAQ
Support

BUSINESS
Overview
Advertising
Support

DEVELOPERS
API

LEGAL
Report a Copyright Violation
Copyright FAQ
Terms of Use
Privacy Policy