Beginning JavaScript with DOM Scripting and Ajax, Second Edition

Book description

Beginning JavaScript with DOM Scripting and Ajax is an essential resource for modern JavaScript programming. This completely updated second edition covers everything you need to know to get up-to-speed with JavaScript development and add dynamic enhancements to web pages, right from the basics. As well as focusing on client-side JavaScript, you will also learn how to work with the Browser Object Model, the Document Object Model (DOM), how to use XML and JSON as well as communicate with service side scripts such as PHP. Find out how to:

  • Construct good JavaScript syntax following modern coding practices

  • Use JavaScript to communicate with the server and retrieve data

  • Dynamically manipulate markup, validate forms and deal with images

  • Debug applications using features inside the browser

  • JavaScript is one of the most important technologies on the web. It provides the means to add dynamic functionality to your web pages and serves as the backbone of Ajax-style web development. Beginning JavaScript with DOM Scripting and Ajax will take you from being a JavaScript novice to work freely with this important technology - begin your JavaScript journey today!

    What you'll learn

  • What functions, variables, events and objects are and how to use them.

  • How build a site that will still work in the case that JavaScript is turned off.

  • How to access and update part of the page using code.

  • How to use JavaScript to communicate with the server and retrieve data.

  • How to use JavaScript to for form validation and user feedback.

  • How to use Third-Party Libraries like jQuery.

  • Who this book is for

    Beginning JavaScript with DOM Scripting and Ajax is for the person who has a good grasp of HTML and CSS but wants to add JavaScript to their skillset. If you want to learn some basic programming concepts, have experience but need help updating your skills, or you're coming from another language, Beginning JavaScript with DOM Scripting and Ajax can help.

    Table of contents

    1. Title Page
    2. Dedication
    3. Contents at a Glance
    4. Contents
    5. About the Authors
    6. About the Technical Reviewer
    7. Acknowledgments
    8. Introduction
    9. CHAPTER 1: Getting Started with JavaScript
      1. The Why of JavaScript
      2. What Is JavaScript?
      3. Problems and Merits of JavaScript
      4. JavaScript in a Web Page and Essential Syntax
      5. Objects
      6. Simple JavaScript Example
      7. Summary
    10. CHAPTER 2: Data and Decisions
      1. Data, Data Types, and Data Operators
      2. The Composite Data Types: Array and Object
      3. Arrays
      4. Making Decisions in JavaScript
      5. Summary
    11. CHAPTER 3: From DHTML to DOM Scripting
      1. JavaScript as the Behavior Layer
      2. JavaScript and Accessibility
      3. Good Coding Practices
      4. Summary
    12. CHAPTER 4: HTML and JavaScript
      1. The Anatomy of an HTML Document
      2. Providing Feedback in Web Pages via JavaScript: The Old-School Ways
      3. Accessing the Document via the DOM
      4. Of Children, Parents, Siblings, and Values
      5. Changing Attributes of Elements
      6. Creating, Removing, and Replacing Elements
      7. Summary
    13. CHAPTER 5: Presentation and Behavior (CSS and Event Handling)
      1. Changing the Presentation Layer via JavaScript
      2. Changing the Document’s Behavior via Event Handling
      3. Summary
    14. CHAPTER 6: Common Uses of JavaScript: Images and Windows
      1. Images and JavaScript
      2. Windows and JavaScript
      3. Summary
    15. CHAPTER 7: JavaScript and User Interaction: Navigation and Forms
      1. Navigation and JavaScript
      2. Forms and JavaScript
      3. Summary
    16. CHAPTER 8: Back-End Interaction with Ajax and Node.js
      1. Household Cleaning Liquid, Football Club, or Flash Gordon’s Spacecraft: What Is Ajax?
      2. Et Tu, Cache?
      3. Putting the X Back into Ajax
      4. Installing Node.js and Getting Started
      5. Modules
      6. Callbacks
      7. Debugging
      8. Summary
    17. CHAPTER 9: Data Validation Techniques
      1. Pros and Cons of Client-Side Validation
      2. A Quick Reminder About Protecting Content with JavaScript
      3. Regular Expressions
      4. Summary of Validation Methods
      5. Constraint Validation
      6. Other Dynamic Validation Methods
      7. Summary
    18. CHAPTER 10: Modern JavaScript Case Study: A Dynamic Gallery
      1. Basics of Thumbnail Galleries
      2. What Is a Thumbnail Gallery and What Should It Do?
      3. Static Thumbnail Galleries
      4. Faking Dynamic Galleries with JavaScript
      5. Displaying Captions
      6. Dynamic Thumbnail Galleries
      7. Creating an Image Badge from a Folder
      8. Summary
    19. CHAPTER 11: Using Third-Party JavaScript
      1. What the Web Offers You
      2. REST APIs and Libraries
      3. Using a Library: Short, Shorter, jQuery
      4. Using an API: Adding a Map to Your Site with Google Maps
      5. Full Service: Introducing Twitter Bootstrap
      6. Summary
    20. APPENDIX A: Debugging JavaScript
      1. Common JavaScript Mistakes
      2. Tracing Errors with alert( ) and “Console” Elements
      3. Error Handling with try and catch( )
      4. Sequential Uncommenting
      5. Built in Developer Tools
      6. JSLint and Jasmine
      7. Lastly
    21. Index

    Product information

    • Title: Beginning JavaScript with DOM Scripting and Ajax, Second Edition
    • Author(s): Russ Ferguson, Christian Heilmann
    • Release date: June 2013
    • Publisher(s): Apress
    • ISBN: 9781430250920