在好例子网,分享、交流、成长!
您当前所在位置:首页CSS 开发实例HTML基础 → Pro HTML5(Pro HTML5 Programming)

Pro HTML5(Pro HTML5 Programming)

HTML基础

下载此实例
  • 开发语言:CSS
  • 实例大小:4.99M
  • 下载次数:8
  • 浏览次数:53
  • 发布时间:2022-11-26
  • 实例类别:HTML基础
  • 发 布 人:王科
  • 文件格式:.pdf
  • 所需积分:2
 相关标签: HTML5 HTML Pro ML Pr

实例介绍

【实例简介】Pro HTML5(Pro HTML5 Programming)

【实例截图】

【核心代码】

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
■ CONTENTS
vi
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
■ CONTENTS
vii
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
■ CONTENTS
viii
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
■ CONTENTS
ix
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
■ CONTENTS
x
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
Handling Errors. ................................................................................................................................... 197
Stopping HTML5 Web Workers. ........................................................................................................... 198
Using HTML5 Web Workers within HTML5 Web Workers..................................................................... 198
Using Timers. ....................................................................................................................................... 199
Simple Example Code. ......................................................................................................................... 199
Building an Application with HTML5 Web Workers........................................................200
Coding the blur.js Helper Script........................................................................................................... 201
Coding the blur.html Application Page ................................................................................................ 203
Coding the blurWorker.js Web Worker Script. ..................................................................................... 204
Communicating with the Web Workers ............................................................................................... 205
The Application in Action..................................................................................................................... 207
Example Code...................................................................................................................................... 207
Summary .......................................................................................................................212
■ ■Chapter 9: Using the HTML5 Web Storage API....................................................213
Overview of HTML5 Web Storage ..................................................................................213
Browser Support for HTML5 Web Storage.....................................................................214
Using the HTML5 Web Storage API................................................................................215
Checking for Browser Support . ........................................................................................................... 215
Download from Wow! eBook <www.wowebook.com>
■ CONTENTS
xi
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
■ CONTENTS
xii
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

标签: HTML5 HTML Pro ML Pr

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警