You are previewing Internet & World Wide Web: How to Program, Fifth Edition.
O'Reilly logo
Internet & World Wide Web: How to Program, Fifth Edition

Book Description

Internet & World Wide Web How to Program, 5/e is appropriate for both introductory and intermediate-level client-side and server-side programming courses. The book is also suitable for professionals who want to update their skills with the latest Internet and web programming technologies.

Internet and World Wide Web How to Program, 5e introduces students with little or no programming experience to the exciting world of Web-Based applications. This new edition focuses on HTML5 and the related technologies in its ecosystem, diving into the exciting new features of HTML5, CSS3, the latest edition of JavaScript (ECMAScript 5) and HTML5 canvas. At the heart of the book is the Deitel signature “live-code approach”—concepts are presented in the context of complete working HTML5 documents, CSS3 stylesheets, JavaScript scripts, XML documents, programs and database files, rather than in code snippets. Each complete code example is accompanied by live sample executions. The Deitels focus on popular key technologies that will help readers build Internet- and web-based applications that interact with other applications and with databases. These form the basis of the kinds of enterprise-level, networked applications that are popular in industry today. After mastering the material in this book, readers will be well prepared to build real-world, industrial strength, Web-based applications.

Table of Contents

  1. Title Page
  2. Copyright Page
  3. Deitel® Series Page
    1. How To Program Series
    2. Simply Series
    3. CourseSmart Web Books
    4. Deitel® Developer Series
    5. LiveLessons Video Learning Products
  4. Dedication
  5. Trademarks
  6. Contents
  7. Preface
    1. New and Updated Features
    2. Dependency Chart
    3. HTML5 Accessibility Online Appendix
    4. HTML5 Geolocation Online Appendix
    5. Teaching Approach
    6. CourseSmart Web Books
    7. Instructor Resources
    8. Acknowledgments
    9. About the Authors
    10. Corporate Training from Deitel & Associates, Inc.
    11. About the Front Cover: Fractal Art
  8. Before You Begin
    1. Obtaining the Source Code
    2. Web Browsers Used in This Book
    3. Web Browser Download Links
    4. Software for the C# and Visual Basic ASP.NET Chapters
    5. Software for the JavaServer Faces and Java Web Services Chapters
  9. 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
    4. 1.4. Demos
    5. 1.5. Evolution of the Internet and World Wide Web
    6. 1.6. Web Basics
    7. 1.7. Multitier Application Architecture
    8. 1.8. Client-Side Scripting versus Server-Side Scripting
    9. 1.9. World Wide Web Consortium (W3C)
    10. 1.10. Web 2.0: Going Social
    11. 1.11. Data Hierarchy
    12. 1.12. Operating Systems
    13. 1.13. Types of Programming Languages
    14. 1.14. Object Technology
    15. 1.15. Keeping Up-to-Date with Information Technologies
    16. Self-Review Exercises
    17. Answers to Self-Review Exercises
    18. Exercises
  10. 2. Introduction to HTML5: Part 1
    1. 2.1. Introduction
    2. 2.2. Editing HTML5
    3. 2.3. First HTML5 Example
    4. 2.4. W3C HTML5 Validation Service
    5. 2.5. Headings
    6. 2.6. Linking
    7. 2.7. Images
    8. 2.8. Special Characters and Horizontal Rules
    9. 2.9. Lists
    10. 2.10. Tables
    11. 2.11. Forms
    12. 2.12. Internal Linking
    13. 2.13. meta Elements
    14. 2.14. Web Resources
    15. Summary
    16. Self-Review Exercises
    17. Answers to Self-Review Exercises
    18. Exercises
  11. 3. Introduction to HTML5: Part 2
    1. 3.1. Introduction
    2. 3.2. New HTML5 Form input Types
    3. 3.3. input and datalist Elements and autocomplete Attribute
    4. 3.4. Page-Structure Elements
    5. Summary
    6. Self-Review Exercises
    7. Answers to Self-Review Exercises
    8. Exercises
  12. 4. Introduction to Cascading Style Sheets™ (CSS): Part 1
    1. 4.1. Introduction
    2. 4.2. Inline Styles
    3. 4.3. Embedded Style Sheets
    4. 4.4. Conflicting Styles
    5. 4.5. Linking External Style Sheets
    6. 4.6. Positioning Elements: Absolute Positioning, z-index
    7. 4.7. Positioning Elements: Relative Positioning, span
    8. 4.8. Backgrounds
    9. 4.9. Element Dimensions
    10. 4.10. Box Model and Text Flow
    11. 4.11. Media Types and Media Queries
    12. 4.12. Drop-Down Menus
    13. 4.13. (Optional) User Style Sheets
    14. 4.14. Web Resources
    15. Summary
    16. Self-Review Exercises
    17. Answers to Self-Review Exercises
    18. Exercises
  13. 5. Introduction to Cascading Style Sheets™ (CSS): Part 2
    1. 5.1. Introduction
    2. 5.2. Text Shadows
    3. 5.3. Rounded Corners
    4. 5.4. Color
    5. 5.5. Box Shadows
    6. 5.6. Linear Gradients; Introducing Vendor Prefixes
    7. 5.7. Radial Gradients
    8. 5.8. (Optional: WebKit Only) Text Stroke
    9. 5.9. Multiple Background Images
    10. 5.10. (Optional: WebKit Only) Reflections
    11. 5.11. Image Borders
    12. 5.12. Animation; Selectors
    13. 5.13. Transitions and Transformations
    14. 5.14. Downloading Web Fonts and the @font-face Rule
    15. 5.15. Flexible Box Layout Module and :nth-child Selectors
    16. 5.16. Multicolumn Layout
    17. 5.17. Media Queries
    18. 5.18. Web Resources
    19. Summary
    20. Self-Review Exercises
    21. Answers to Self-Review Exercises
    22. Exercises
  14. 6. JavaScript: Introduction to Scripting
    1. 6.1. Introduction
    2. 6.2. Your First Script: Displaying a Line of Text with JavaScript in a Web Page
    3. 6.3. Modifying Your First Script
    4. 6.4. Obtaining User Input with prompt Dialogs
    5. 6.5. Memory Concepts
    6. 6.6. Arithmetic
    7. 6.7. Decision Making: Equality and Relational Operators
    8. 6.8. Web Resources
    9. Summary
    10. Self-Review Exercises
    11. Answers to Self-Review Exercises
    12. Exercises
  15. 7. JavaScript: Control Statements I
    1. 7.1. Introduction
    2. 7.2. Algorithms
    3. 7.3. Pseudocode
    4. 7.4. Control Statements
    5. 7.5. if Selection Statement
    6. 7.6. if...else Selection Statement
    7. 7.7. while Repetition Statement
    8. 7.8. Formulating Algorithms: Counter-Controlled Repetition
    9. 7.9. Formulating Algorithms: Sentinel-Controlled Repetition
    10. 7.10. Formulating Algorithms: Nested Control Statements
    11. 7.11. Assignment Operators
    12. 7.12. Increment and Decrement Operators
    13. 7.13. Web Resources
    14. Summary
    15. Self-Review Exercises
    16. Answers to Self-Review Exercises
    17. Exercises
  16. 8. JavaScript: Control Statements II
    1. 8.1. Introduction
    2. 8.2. Essentials of Counter-Controlled Repetition
    3. 8.3. for Repetition Statement
    4. 8.4. Examples Using the for Statement
    5. 8.5. switch Multiple-Selection Statement
    6. 8.6. do...while Repetition Statement
    7. 8.7. break and continue Statements
    8. 8.8. Logical Operators
    9. 8.9. Web Resources
    10. Summary
    11. Self-Review Exercises
    12. Answers to Self-Review Exercises
    13. Exercises
  17. 9. JavaScript: Functions
    1. 9.1. Introduction
    2. 9.2. Program Modules in JavaScript
    3. 9.3. Function Definitions
    4. 9.4. Notes on Programmer-Defined Functions
    5. 9.5. Random Number Generation
    6. 9.6. Example: Game of Chance; Introducing the HTML5 audio and video Elements
    7. 9.7. Scope Rules
    8. 9.8. JavaScript Global Functions
    9. 9.9. Recursion
    10. 9.10. Recursion vs. Iteration
    11. Summary
    12. Self-Review Exercises
    13. Answers to Self-Review Exercises
    14. Exercises
  18. 10. JavaScript: Arrays
    1. 10.1. Introduction
    2. 10.2. Arrays
    3. 10.3. Declaring and Allocating Arrays
    4. 10.4. Examples Using Arrays
    5. 10.5. Random Image Generator Using Arrays
    6. 10.6. References and Reference Parameters
    7. 10.7. Passing Arrays to Functions
    8. 10.8. Sorting Arrays with Array Method sort
    9. 10.9. Searching Arrays with Array Method indexOf
    10. 10.10. Multidimensional Arrays
    11. Summary
    12. Self-Review Exercises
    13. Answers to Self-Review Exercises
    14. Exercises
  19. 11. JavaScript: Objects
    1. 11.1. Introduction
    2. 11.2. Math Object
    3. 11.3. String Object
    4. 11.4. Date Object
    5. 11.5. Boolean and Number Objects
    6. 11.6. document Object
    7. 11.7. Favorite Twitter Searches: HTML5 Web Storage
    8. 11.8. Using JSON to Represent Objects
    9. Summary
    10. Self-Review Exercise
    11. Answers to Self-Review Exercise
    12. Exercises
    13. Special Section: Challenging String-Manipulation Projects
  20. 12. Document Object Model (DOM): Objects and Collections
    1. 12.1. Introduction
    2. 12.2. Modeling a Document: DOM Nodes and Trees
    3. 12.3. Traversing and Modifying a DOM Tree
    4. 12.4. DOM Collections
    5. 12.5. Dynamic Styles
    6. 12.6. Using a Timer and Dynamic Styles to Create Animated Effects
    7. Summary
    8. Self-Review Exercises
    9. Answers to Self-Review Exercises
    10. Exercises
  21. 13. JavaScript Event Handling: A Deeper Look
    1. 13.1. Introduction
    2. 13.2. Reviewing the load Event
    3. 13.3. Event mousemove and the event Object
    4. 13.4. Rollovers with mouseover and mouseout
    5. 13.5. Form Processing with focus and blur
    6. 13.6. More Form Processing with submit and reset
    7. 13.7. Event Bubbling
    8. 13.8. More Events
    9. 13.9. Web Resource
    10. Summary
    11. Self-Review Exercises
    12. Answers to Self-Review Exercises
    13. Exercises
  22. 14. HTML5: Introduction to canvas
    1. 14.1. Introduction1
    2. 14.2. canvas Coordinate System
    3. 14.3. Rectangles
    4. 14.4. Using Paths to Draw Lines
    5. 14.5. Drawing Arcs and Circles
    6. 14.6. Shadows
    7. 14.7. Quadratic Curves
    8. 14.8. Bezier Curves
    9. 14.9. Linear Gradients
    10. 14.10. Radial Gradients
    11. 14.11. Images
    12. 14.12. Image Manipulation: Processing the Individual Pixels of a canvas
    13. 14.13. Patterns
    14. 14.14. Transformations
    15. 14.15. Text
    16. 14.16. Resizing the canvas to Fill the Browser Window
    17. 14.17. Alpha Transparency
    18. 14.18. Compositing
    19. 14.19. Cannon Game
    20. 14.20. save and restore Methods
    21. 14.21. A Note on SVG
    22. 14.22. A Note on canvas 3D
    23. Summary
    24. Self-Review Exercises
    25. Answers to Self-Review Exercises
    26. Exercises
  23. 15. XML
    1. 15.1. Introduction
    2. 15.2. XML Basics
    3. 15.3. Structuring Data
    4. 15.4. XML Namespaces
    5. 15.5. Document Type Definitions (DTDs)
    6. 15.6. W3C XML Schema Documents
    7. 15.7. XML Vocabularies
    8. 15.8. Extensible Stylesheet Language and XSL Transformations
    9. 15.9. Document Object Model (DOM)
    10. 15.10. Web Resources
    11. Summary
    12. Self-Review Exercises
    13. Answers to Self-Review Exercises
    14. Exercises
  24. 16. Ajax-Enabled Rich Internet Applications with XML and JSON
    1. 16.1. Introduction
    2. 16.2. Rich Internet Applications (RIAs) with Ajax
    3. 16.3. History of Ajax
    4. 16.4. “Raw” Ajax Example Using the XMLHttpRequest Object
    5. 16.5. Using XML and the DOM
    6. 16.6. Creating a Full-Scale Ajax-Enabled Application
    7. Summary
    8. Self-Review Exercises
    9. Answers to Self-Review Exercises
    10. Exercises
  25. 17. Web Servers (Apache and IIS)
    1. 17.1. Introduction
    2. 17.2. HTTP Transactions
    3. 17.3. Multitier Application Architecture
    4. 17.4. Client-Side Scripting versus Server-Side Scripting
    5. 17.5. Accessing Web Servers
    6. 17.6. Apache, MySQL and PHP Installation
    7. 17.7. Microsoft IIS Express and WebMatrix
  26. 18. Database: SQL, MySQL, LINQ and Java DB
    1. 18.1. Introduction
    2. 18.2. Relational Databases
    3. 18.3. Relational Database Overview: A books Database
    4. 18.4. SQL
    5. 18.5. MySQL
    6. 18.6. (Optional) Microsoft Language Integrate Query (LINQ)
    7. 18.7. (Optional) LINQ to SQL
    8. 18.8. (Optional) Querying a Database with LINQ
    9. 18.9. (Optional) Dynamically Binding LINQ to SQL Query Results
    10. 18.10. Java DB/Apache Derby
    11. Summary
    12. Self-Review Exercises
    13. Answers to Self-Review Exercises
    14. Exercises
  27. 19. PHP
    1. 19.1. Introduction
    2. 19.2. Simple PHP Program
    3. 19.3. Converting Between Data Types
    4. 19.4. Arithmetic Operators
    5. 19.5. Initializing and Manipulating Arrays
    6. 19.6. String Comparisons
    7. 19.7. String Processing with Regular Expressions
    8. 19.8. Form Processing and Business Logic
    9. 19.9. Reading from a Database
    10. 19.10. Using Cookies
    11. 19.11. Dynamic Content
    12. 19.12. Web Resources
    13. Summary
    14. Self-Review Exercises
    15. Answers to Self-Review Exercises
    16. Exercises
  28. 20. Web App Development with ASP.NET in C#
    1. 20.1. Introduction
    2. 20.2. Web Basics
    3. 20.3. Multitier Application Architecture
    4. 20.4. Your First ASP.NET Application
    5. 20.5. Standard Web Controls: Designing a Form
    6. 20.6. Validation Controls
    7. 20.7. Session Tracking
    8. 20.8. Case Study: Database-Driven ASP.NET Guestbook
    9. 20.9. Case Study Introduction: ASP.NET AJAX
    10. 20.10. Case Study Introduction: Password-Protected Books Database Application
    11. Summary
    12. Self-Review Exercises
    13. Answers to Self-Review Exercises
    14. Exercises
  29. 21. Web App Development with ASP.NET in C#: A Deeper Look
    1. 21.1. Introduction
    2. 21.2. Case Study: Password-Protected Books Database Application
    3. 21.3. ASP.NET Ajax
    4. Summary
    5. Self-Review Exercises
    6. Answers to Self-Review Exercises
    7. Exercises
  30. 22. Web Services in C#
    1. 22.1. Introduction
    2. 22.2. WCF Services Basics
    3. 22.3. Simple Object Access Protocol (SOAP)
    4. 22.4. Representational State Transfer (REST)
    5. 22.5. JavaScript Object Notation (JSON)
    6. 22.6. Publishing and Consuming SOAP-Based WCF Web Services
    7. 22.7. Publishing and Consuming REST-Based XML Web Services
    8. 22.8. Publishing and Consuming REST-Based JSON Web Services
    9. 22.9. Blackjack Web Service: Using Session Tracking in a SOAP-Based WCF Web Service
    10. 22.10. Airline Reservation Web Service: Database Access and Invoking a Service from ASP.NET
    11. 22.11. Equation Generator: Returning User-Defined Types
    12. 22.12. Web Resources
    13. Summary
    14. Self-Review Exercises
    15. Answers to Self-Review Exercises
    16. Exercises
  31. 23. Web App Development with ASP.NET in Visual Basic
    1. 23.1. Introduction
    2. 23.2. Web Basics
    3. 23.3. Multitier Application Architecture
    4. 23.4. Your First ASP.NET Application
    5. 23.5. Standard Web Controls: Designing a Form
    6. 23.6. Validation Controls
    7. 23.7. Session Tracking
    8. 23.8. Case Study: Database-Driven ASP.NET Guestbook
    9. 23.9. Online Case Study: ASP.NET AJAX
    10. 23.10. Online Case Study: Password-Protected Books Database Application
    11. Summary
    12. Self-Review Exercises
    13. Answers to Self-Review Exercises
    14. Exercises
  32. A. HTML Special Characters
  33. B. HTML Colors
  34. C. JavaScript Operator Precedence Chart
  35. D. ASCII Character Set
  36. Index
  37. 24. Web App Development with ASP.NET in VB: A Deeper Look
    1. 24.1. Introduction
    2. 24.2. Case Study: Password-Protected Books Database Application
    3. 24.3. ASP.NET Ajax
    4. Summary
    5. Self-Review Exercises
    6. Answers to Self-Review Exercises
    7. Exercises
  38. 25. Web Services in Visual Basic
    1. 25.1. Introduction
    2. 25.2. WCF Services Basics
    3. 25.3. Simple Object Access Protocol (SOAP)
    4. 25.4. Representational State Transfer (REST)
    5. 25.5. JavaScript Object Notation (JSON)
    6. 25.6. Publishing and Consuming SOAP-Based WCF Web Services
    7. 25.7. Publishing and Consuming REST-Based XML Web Services
    8. 25.8. Publishing and Consuming REST-Based JSON Web Services
    9. 25.9. Blackjack Web Service: Using Session Tracking in a SOAP-Based WCF Web Service
    10. 25.10. Airline Reservation Web Service: Database Access and Invoking a Service from ASP.NET
    11. 25.11. Equation Generator: Returning User-Defined Types
    12. 25.12. Web Resources
    13. Summary
    14. Self-Review Exercises
    15. Answers to Self-Review Exercises
    16. Exercises
  39. 26. JavaServer™ Faces Web Apps: Part 1
    1. 26.1. Introduction
    2. 26.2. HyperText Transfer Protocol (HTTP) Transactions
    3. 26.3. Multitier Application Architecture
    4. 26.4. Your First JSF Web App
    5. 26.5. Model-View-Controller Architecture of JSF Apps
    6. 26.6. Common JSF Components
    7. 26.7. Validation Using JSF Standard Validators
    8. 26.8. Session Tracking
    9. Summary
    10. Self-Review Exercises
    11. Answers to Self-Review Exercises
    12. Exercises
  40. 27. JavaServer™ Faces Web Apps: Part 2
    1. 27.1. Introduction
    2. 27.2. Accessing Databases in Web Apps
    3. 27.3. Ajax
    4. 27.4. Adding Ajax Functionality to the Validation App
    5. Summary
    6. Self-Review Exercise
    7. Answers to Self-Review Exercise
    8. Exercises
  41. 28. Web Services in Java
    1. 28.1. Introduction
    2. 28.2. Web Service Basics
    3. 28.3. Simple Object Access Protocol (SOAP)
    4. 28.4. Representational State Transfer (REST)
    5. 28.5. JavaScript Object Notation (JSON)
    6. 28.6. Publishing and Consuming SOAP-Based Web Services
    7. 28.7. Publishing and Consuming REST-Based XML Web Services
    8. 28.8. Publishing and Consuming REST-Based JSON Web Services
    9. 28.9. Session Tracking in a SOAP Web Service
    10. 28.10. Consuming a Database-Driven SOAP Web Service
    11. 28.11. Equation Generator: Returning User-Defined Types
    12. Summary
    13. Self-Review Exercises
    14. Answers to Self-Review Exercises
    15. Exercises
  42. 29. HTML5 WebSockets and Web Workers [This content is currently in development.]
  43. E. Number Systems
    1. E.1. Introduction
    2. E.2. Abbreviating Binary Numbers as Octal and Hexadecimal Numbers
    3. E.3. Converting Octal and Hexadecimal Numbers to Binary Numbers
    4. E.4. Converting from Binary, Octal or Hexadecimal to Decimal
    5. E.5. Converting from Decimal to Binary, Octal or Hexadecimal
    6. E.6. Negative Binary Numbers: Two’s Complement Notation
    7. Summary
    8. Self-Review Exercises
    9. Answers to Self-Review Exercises
    10. Exercises
  44. F. Unicode®
    1. F.1. Introduction
    2. F.2. Unicode Transformation Formats
    3. F.3. Characters and Glyphs
    4. F.4. Advantages/Disadvantages of Unicode
    5. F.5. Using Unicode
    6. F.6. Character Ranges
  45. Online Access