logo资料库

Exam Ref 70-480 Programming in HTML5 with JavaScript and CSS3.pdf

第1页 / 共353页
第2页 / 共353页
第3页 / 共353页
第4页 / 共353页
第5页 / 共353页
第6页 / 共353页
第7页 / 共353页
第8页 / 共353页
资料共353页,剩余部分请下载后查看
Contents
Introduction
Microsoft certifications
Free ebooks from Microsoft Press
Errata, updates, & book support
We want to hear from you
Stay in touch
Preparing for the exam
Chapter 1 Implement and manipulate document structures and objects
Objective 1.1: Create the document structure
Using HTML5 semantic markup
Creating a layout container in HTML
Optimizing for search engines
Optimizing for screen readers
Objective summary
Objective review
Objective 1.2: Write code that interacts with UI controls
Adding or modifying HTML elements
Implementing media controls
Implementing graphics with HTML5 and SVG
Objective summary
Objective review
Objective 1.3: Apply styling to HTML elements programmatically
Changing the location of an element
Applying a transform
Showing and hiding elements
Objective summary
Objective review
Objective 1.4: Implement HTML5 APIs
Using the storage API
Using the AppCache API
Using the Geolocation API
Objective summary
Objective review
Objective 1.5: Establish the scope of objects and variables
Establishing the lifetime of variables and variable scope
Avoiding using the global namespace
Leveraging the this keyword
Objective summary
Objective review
Objective 1.6: Create and implement objects and methods
Implementing native objects
Creating custom objects
Implementing inheritance
Objective summary
Objective review
Answers
Chapter 2 Implement program flow
Objective 2.1: Implement program flow
Evaluating expressions
Working with arrays
Implementing special types of arrays
Using advanced array methods
Implementing iterative control flow
Objective summary
Objective review
Objective 2.2: Raise and handle an event
Using events
Handling DOM events
Creating custom events
Objective summary
Objective review
Objective 2.3: Implement exception handling
Implementing try…catch…finally constructs
Checking for null values
Objective summary
Objective review
Objective 2.4: Implement a callback
Implementing bidirectional communication with the WebSocket API
Making webpages dynamic with jQuery and AJAX
Wiring up an event with jQuery
Implementing a callback with an anonymous function
Using the this pointer
Objective summary
Objective review
Objective 2.5: Create a web worker process
Getting started with a web worker process
Creating a worker process with the Web Worker API
Using web workers
Understanding web worker limitations
Configuring timeouts and intervals
Objective summary
Objective review
Answers
Chapter 3 Access and secure data
Objective 3.1: Validate user input by using HTML5 elements
Choosing input controls
Implementing content attributes
Objective summary
Objective review
Objective 3.2: Validate user input by using JavaScript
Evaluating regular expressions
Evaluating regular expressions in JavaScript
Validating data with built-in functions
Preventing code injection
Objective summary
Objective review
Objective 3.3: Consume data
Consuming JSON and XML data by using web services
Using the XMLHttpRequest object
Objective summary
Objective review
Objective 3.4: Serialize, deserialize, and transmit data
Sending data by using XMLHttpRequest
Serializing and deserializing JSON data
Serializing and deserializing binary data
Objective summary
Objective review
Answers
Chapter 4 Use CSS3 in applications
Objective 4.1: Style HTML text properties
Apply styles to text appearance
Apply styles to text font
Applying styles to text alignment, spacing, and indentation
Applying styles to text hyphenation
Applying styles for a text drop shadow
Objective summary
Objective review
Objective 4.2: Style HTML box properties
Applying styles to alter appearance attributes
Applying styles to alter graphic effects
Apply styles to establish and change an element’s position
Objective summary
Objective review
Objective 4.3: Create a flexible content layout
Implement a layout using a flexible box model
Implementing a layout using multi-column
Implementing a layout using position, floating, and exclusions
Implementing a layout using grid alignment
Implementing a layout using regions, grouping, and nesting
Objective summary
Objective review
Objective 4.4: Create an animated and adaptive UI
Animating objects by applying CSS transitions
Applying 3-D and 2-D transformations
Adjusting UI based on media queries
Hiding or disabling controls
Objective summary
Objective review
Objective 4.5: Find elements using CSS selectors and jQuery
Defining element, style, and attribute selectors
Choosing the correct selector to reference an element
Finding elements by using pseudo-elements and pseudo-classes
Objective summary
Objective review
Objective 4.6: Structure a CSS file by using CSS selectors
Referencing elements correctly
Implementing inheritance
Overriding inheritance using !important
Styling an element based on pseudo-elements and pseudo-classes
Objective summary
Objective review
Answers
Index
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Z
ptg14200515From the Library of Ida Schander
Exam Ref 70-480 Programming in HTML5 with JavaScript and CSS3 Rick Delorme
PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2014 by Rick Delorme All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. Library of Congress Control Number: 2014940678 ISBN: 978-0-7356-7663-3 Printed and bound in the United States of America. First Printing Microsoft Press books are available through booksellers and distributors worldwide. If you need support related to this book, email Microsoft Press Book Support at mspinput@microsoft.com. Please tell us what you think of this book at http://www.microsoft.com/learning/booksurvey. Microsoft and the trademarks listed at http://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/ EN-US.aspx are trademarks of the Microsoft group of companies. All other marks are property of their respective owners. The example companies, organizations, products, domain names, email addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred. This book expresses the author’s views and opinions. The information contained in this book is provided without any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book. Acquisitions Editor: Anne Hamilton Developmental Editor: Karen Szall Editorial Production: Box Twelve Communications Technical Reviewer: Todd Meister Cover: Twist Creative • Seattle ptg14200515From the Library of Ida Schander
Contents Introduction Microsoft certifications Free ebooks from Microsoft Press Errata, updates, & book support We want to hear from you Stay in touch Preparing for the exam ix ix x x x x xi Chapter 1 Implement and manipulate document structures and objects 1 Objective 1.1: Create the document structure . . . . . . . . . . . . . . . . . . . . . . . . . 2 2 15 16 17 20 21 Using HTML5 semantic markup Creating a layout container in HTML Optimizing for search engines Optimizing for screen readers Objective summary Objective review Objective 1.2: Write code that interacts with UI controls . . . . . . . . . . . . . . 22 22 34 39 58 59 Adding or modifying HTML elements Implementing media controls Implementing graphics with HTML5 and SVG Objective summary Objective review What do you think of this book? We want to hear from you! Microsoft is interested in hearing your feedback so we can continually improve our books and learning resources for you. To participate in a brief online survey, please visit: www.microsoft.com/learning/booksurvey/ iii ptg14200515From the Library of Ida Schander
Objective 1.3: Apply styling to HTML elements programmatically . . . . . . 60 61 63 67 71 71 Changing the location of an element Applying a transform Showing and hiding elements Objective summary Objective review Objective 1.4: Implement HTML5 APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 72 77 81 85 85 Using the storage API Using the AppCache API Using the Geolocation API Objective summary Objective review Objective 1.5: Establish the scope of objects and variables . . . . . . . . . . . . 86 87 90 91 92 92 Establishing the lifetime of variables and variable scope Avoiding using the global namespace Leveraging the this keyword Objective summary Objective review Objective 1.6: Create and implement objects and methods . . . . . . . . . . . . 93 94 95 99 101 101 Implementing native objects Creating custom objects Implementing inheritance Objective summary Objective review Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Chapter 2 111 Implement program flow Objective 2.1: Implement program flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 112 117 121 122 Evaluating expressions Working with arrays Implementing special types of arrays Using advanced array methods iv ptg14200515ContentsFrom the Library of Ida Schander
Implementing iterative control flow Objective summary Objective review 125 129 130 Objective 2.2: Raise and handle an event . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 131 139 146 147 148 Using events Handling DOM events Creating custom events Objective summary Objective review Objective 2.3: Implement exception handling . . . . . . . . . . . . . . . . . . . . . . . 149 149 154 155 155 Implementing try…catch…finally constructs Checking for null values Objective summary Objective review Objective 2.4: Implement a callback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 Implementing bidirectional communication with the WebSocket API Making webpages dynamic with jQuery and AJAX Wiring up an event with jQuery Implementing a callback with an anonymous function Using the this pointer Objective summary Objective review 157 161 165 167 169 170 171 Objective 2.5: Create a web worker process. . . . . . . . . . . . . . . . . . . . . . . . . 172 172 176 178 179 180 181 181 Getting started with a web worker process Creating a worker process with the Web Worker API Using web workers Understanding web worker limitations Configuring timeouts and intervals Objective summary Objective review Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 v ptg14200515ContentsFrom the Library of Ida Schander
Chapter 3 Access and secure data 189 Objective 3.1: Validate user input by using HTML5 elements . . . . . . . . . . 190 190 206 209 210 Choosing input controls Implementing content attributes Objective summary Objective review Objective 3.2: Validate user input by using JavaScript . . . . . . . . . . . . . . . . 211 211 214 216 216 217 218 Evaluating regular expressions Evaluating regular expressions in JavaScript Validating data with built-in functions Preventing code injection Objective summary Objective review Objective 3.3: Consume data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 219 219 223 223 Consuming JSON and XML data by using web services Using the XMLHttpRequest object Objective summary Objective review Objective 3.4: Serialize, deserialize, and transmit data . . . . . . . . . . . . . . . . 224 224 225 225 228 229 Sending data by using XMLHttpRequest Serializing and deserializing JSON data Serializing and deserializing binary data Objective summary Objective review Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 Chapter 4 Use CSS3 in applications 235 Objective 4.1: Style HTML text properties . . . . . . . . . . . . . . . . . . . . . . . . . . 235 236 238 239 241 Apply styles to text appearance Apply styles to text font Applying styles to text alignment, spacing, and indentation Applying styles to text hyphenation vi ptg14200515ContentsFrom the Library of Ida Schander
Applying styles for a text drop shadow Objective summary Objective review 242 243 243 Objective 4.2: Style HTML box properties . . . . . . . . . . . . . . . . . . . . . . . . . . 244 244 249 258 264 265 Applying styles to alter appearance attributes Applying styles to alter graphic effects Apply styles to establish and change an element’s position Objective summary Objective review Objective 4.3: Create a flexible content layout . . . . . . . . . . . . . . . . . . . . . . 266 266 Implement a layout using a flexible box model Implementing a layout using multi-column 273 Implementing a layout using position, floating, and exclusions 276 Implementing a layout using grid alignment 280 286 Implementing a layout using regions, grouping, and nesting 287 Objective summary Objective review 288 Objective 4.4: Create an animated and adaptive UI . . . . . . . . . . . . . . . . . . 288 289 291 292 297 299 299 Animating objects by applying CSS transitions Applying 3-D and 2-D transformations Adjusting UI based on media queries Hiding or disabling controls Objective summary Objective review Objective 4.5: Find elements using CSS selectors and jQuery . . . . . . . . .300 300 301 Defining element, style, and attribute selectors Choosing the correct selector to reference an element Finding elements by using pseudo-elements and pseudo-classes Objective summary Objective review 301 304 305 vii ptg14200515ContentsFrom the Library of Ida Schander
分享到:
收藏