
| Preface xix Before You Begin xxxi 1 Introduction to Computers and the Internet 1 1.1 Introduction 2 1.2 The Internet in Industry and Research 3 1.3 HTML5, CSS3, JavaScript, Canvas and jQuery 6 1.4 Demos 9 1.5 Evolution of the Internet and World Wide Web 10 1.6 Web Basics 12 1.7 Multitier Application Architecture 16 1.8 Client-Side Scripting versus Server-Side Scripting 17 1.9 World Wide Web Consortium (W3C) 18 1.10 Web 2.0: Going Social 18 1.11 Data Hierarchy 23 1.12 Operating Systems 25 1.12.1 Desktop and Notebook Operating Systems 25 1.12.2 Mobile Operating Systems 26 1.13 Types of Programming Languages 27 1.14 Object Technology 29 1.15 Keeping Up-to-Date with Information Technologies 31 2 Introduction to HTML5: Part 1 37 2.1 Introduction 38 2.2 Editing HTML5 38 2.3 First HTML5 Example 38 2.4 W3C HTML5 Validation Service 41 2.5 Headings 41 2.6 Linking 42 2.7 Images 45 2.7.1 alt Attribute 47 2.7.2 Void Elements 47 2.7.3 Using Images as Hyperlinks 47 2.8 Special Characters and Horizontal Rules 49 2.9 Lists 51 2.10 Tables 54 2.11 Forms 58 2.12 Internal Linking 65 2.13 meta Elements 67 2.14 Web Resources 69 3 Introduction to HTML5: Part 2 76 3.1 Introduction 77 3.2 New HTML5 Form input Types 77 3.2.1 input Type color 80 3.2.2 input Type date 82 3.2.3 input Type datetime 82 3.2.4 input Type datetime-local 82 3.2.5 input Type email 83 3.2.6 input Type month 84 3.2.7 input Type number 84 3.2.8 input Type range 85 3.2.9 input Type search 85 3.2.10 input Type tel 86 3.2.11 input Type time 86 3.2.12 input Type url 87 3.2.13 input Type week 87 3.3 input and datalist Elements and autocomplete Attribute 87 3.3.1 input Element autocomplete Attribute 87 3.3.2 datalist Element 90 3.4 Page-Structure Elements 90 3.4.1 header Element 96 3.4.2 nav Element 96 3.4.3 figure Element and figcaption Element 96 3.4.4 article Element 96 3.4.5 summary Element and details Element 96 3.4.6 section Element 96 3.4.7 aside Element 96 3.4.8 meter Element 97 3.4.9 footer Element 98 3.4.10 Text-Level Semantics: mark Element and wbr Element 98 4 Introduction to Cascading Style Sheets™ (CSS): Part 1 105 4.1 Introduction 106 4.2 Inline Styles 106 4.3 Embedded Style Sheets 108 4.4 Conflicting Styles 111 4.5 Linking External Style Sheets 114 4.6 Positioning Elements: Absolute Positioning, z-index 116 4.7 Positioning Elements: Relative Positioning, span 118 4.8 Backgrounds 120 4.9 Element Dimensions 122 4.10 Box Model and Text Flow 123 4.11 Media Types and Media Queries 127 4.12 Drop-Down Menus 130 4.13 (Optional) User Style Sheets 132 4.14 Web Resources 136 5 Introduction to Cascading Style Sheets™ (CSS): Part 2 142 5.1 Introduction 143 5.2 Text Shadows 143 5.3 Rounded Corners 144 5.4 Color 145 5.5 Box Shadows 146 5.6 Linear Gradients; Introducing Vendor Prefixes 148 5.7 Radial Gradients 151 5.8 (Optional: WebKit Only) Text Stroke 153 5.9 Multiple Background Images 153 5.10 (Optional: WebKit Only) Reflections 155 5.11 Image Borders 156 5.12 Animation; Selectors 159 5.13 Transitions and Transformations 162 5.13.1 transition and transform Properties 162 5.13.2 Skew 164 5.13.3 Transitioning Between Images 165 5.14 Downloading Web Fonts and the @font-face Rule 166 5.15 Flexible Box Layout Module and :nth-child Selectors 168 5.16 Multicolumn Layout 171 5.17 Media Queries 173 5.18 Web Resources 177 6 JavaScript: Introduction to Scripting 185 6.1 Introduction 186 6.2 Your First Script: Displaying a Line of Text with JavaScript in a Web Page 186 6.3 Modifying Your First Script 189 6.4 Obtaining User Input with prompt Dialogs 192 6.4.1 Dynamic Welcome Page 192 6.4.2 Adding Integers 196 6.5 Memory Concepts 199 6.6 Arithmetic 200 6.7 Decision Making: Equality and Relational Operators 202 6.8 Web Resources 207 7 JavaScript: Control Statements I 214 7.1 Introduction 215 7.2 Algorithms 215 7.3 Pseudocode 215 7.4 Control Statements 215 7.5 if Selection Statement 218 7.6 if…else Selection Statement 219 7.7 while Repetition Statement 223 7.8 Formulating Algorithms: Counter-Controlled Repetition 225 7.9 Formulating Algorithms: Sentinel-Controlled Repetition 228 7.10 Formulating Algorithms: Nested Control Statements 234 7.11 Assignment Operators 238 7.12 Increment and Decrement Operators 239 7.13 Web Resources 242 8 JavaScript: Control Statements II 251 8.1 Introduction 252 8.2 Essentials of Counter-Controlled Repetition 252 8.3 for Repetition Statement 253 8.4 Examples Using the for Statement 256 8.5 switch Multiple-Selection Statement 261 8.6 do…while Repetition Statement 264 8.7 break and continue Statements 266 8.8 Logical Operators 268 8.9 Web Resources 271 9 JavaScript: Functions 278 9.1 Introduction 279 9.2 Program Modules in JavaScript 279 9.3 Function Definitions 280 9.3.1 Programmer-Defined Function square 281 9.3.2 Programmer-Defined Function maximum 283 9.4 Notes on Programmer-Defined Functions 285 9.5 Random Number Generation 286 9.5.1 Scaling and Shifting Random Numbers 286 9.5.2 Displaying Random Images 287 9.5.3 Rolling Dice Repeatedly and Displaying Statistics 291 9.6 Example: Game of Chance; Introducing the HTML5 audio and video Elements 296 9.7 Scope Rules 306 9.8 JavaScript Global Functions 308 9.9 Recursion 309 9.10 Recursion vs. Iteration 313 10 JavaScript: Arrays 324 10.1 Introduction 325 10.2 Arrays 325 10.3 Declaring and Allocating Arrays 327 10.4 Examples Using Arrays 327 10.4.1 Creating, Initializing and Growing Arrays 327 10.4.2 Initializing Arrays with Initializer Lists 331 10.4.3 Summing the Elements of an Array with for and for…in 332 10.4.4 Using the Elements of an Array as Counters 334 10.5 Random Image Generator Using Arrays 337 10.6 References and Reference Parameters 339 10.7 Passing Arrays to Functions 340 10.8 Sorting Arrays with Array Method sort 343 10.9 Searching Arrays with Array Method indexOf 344 10.10 Multidimensional Arrays 347 11 JavaScript: Objects 360 11.1 Introduction 361 11.2 Math Object 361 11.3 String Object 363 11.3.1 Fundamentals of Characters and Strings 363 11.3.2 Methods of the String Object 363 11.3.3 Character-Processing Methods 365 11.3.4 Searching Methods 366 11.3.5 Splitting Strings and Obtaining Substrings 369 11.4 Date Object 371 11.5 Boolean and Number Objects 376 11.6 document Object 377 11.7 Favorite Twitter Searches: HTML5 Web Storage 378 11.8 Using JSON to Represent Objects 385 12 Document Object Model (DOM): Objects and Collections 395 12.1 Introduction 396 12.2 Modeling a Document: DOM Nodes and Trees 396 12.3 Traversing and Modifying a DOM Tree 399 12.4 DOM Collections 409 12.5 Dynamic Styles 411 12.6 Using a Timer and Dynamic Styles to Create Animated Effects 413 13 JavaScript Event Handling: A Deeper Look 422 13.1 Introduction 423 13.2 Reviewing the load Event 423 13.3 Event mousemove and the event Object 425 13.4 Rollovers with mouseover and mouseout 429 13.5 Form Processing with focus and blur 433 13.6 More Form Processing with submit and reset 436 13.7 Event Bubbling 438 13.8 More Events 440 13.9 Web Resource 440 14 HTML5: Introduction to canvas 444 14.1 Introduction 445 14.2 canvas Coordinate System 445 14.3 Rectangles 446 14.4 Using Paths to Draw Lines 448 14.5 Drawing Arcs and Circles 450 14.6 Shadows 452 14.7 Quadratic Curves 454 14.8 Bezier Curves 456 14.9 Linear Gradients 457 14.10 Radial Gradients 459 14.11 Images 461 14.12 Image Manipulation: Processing the Individual Pixels of a canvas 463 14.13 Patterns 467 14.14 Transformations 468 14.14.1 scale and translate Methods: Drawing Ellipses 468 14.14.2 rotate Method: Creating an Animation 470 14.14.3 transform Method: Drawing Skewed Rectangles 472 14.15 Text 474 14.16 Resizing the canvas to Fill the Browser Window 476 14.17 Alpha Transparency 477 14.18 Compositing 479 14.19 Cannon Game 482 14.19.1 HTML5 Document 484 14.19.2 Instance Variables and Constants 484 14.19.3 Function setupGame 486 14.19.4 Functions startTimer and stopTimer 487 14.19.5 Function resetElements 487 14.19.6 Function newGame 488 14.19.7 Function updatePositions: Manual Frame-by-Frame Animation and Simple Collision Detection 489 14.19.8 Function fireCannonball 492 14.19.9 Function alignCannon 493 14.19.10 Function draw 494 14.19.11 Function showGameOverDialog 496 14.20 save and restore Methods 496 14.21 A Note on SVG 498 14.22 A Note on canvas 3D 499 15 XML 511 15.1 Introduction 512 15.2 XML Basics 512 15.3 Structuring Data 515 15.4 XML Namespaces 521 15.5 Document Type Definitions (DTDs) 523 15.6 W3C XML Schema Documents 526 15.7 XML Vocabularies 534 15.7.1 MathML™ 534 15.7.2 Other Markup Languages 537 15.8 Extensible Stylesheet Language and XSL Transformations 538 15.9 Document Object Model (DOM) 547 15.10 Web Resources 565 16 Ajax-Enabled Rich Internet Applications with XML and JSON 571 16.1 Introduction 572 16.1.1 Traditional Web Applications vs. Ajax Applications 573 16.1.2 Traditional Web Applications 573 16.1.3 Ajax Web Applications 574 16.2 Rich Internet Applications (RIAs) with Ajax 574 16.3 History of Ajax 577 16.4 “Raw” Ajax Example Using the XMLHttpRequest Object 577 16.4.1 Asynchronous Requests 578 16.4.2 Exception Handling 581 16.4.3 Callback Functions 582 16.4.4 XMLHttpRequest Object Event, Properties and Methods 582 16.5 Using XML and the DOM 583 16.6 Creating a Full-Scale Ajax-Enabled Application 587 16.6.1 Using JSON 587 16.6.2 Rich Functionality 588 16.6.3 Interacting with a Web Service on the Server 597 16.6.4 Parsing JSON Data 597 16... |
商品评论(0条)