JavaScript for Absolute Beginners [electronic resource] /
McNavage, Terry.author.
If you are new to both JavaScript and programming, this hands-on book is for you. Rather than staring blankly at gobbledygook, you'll explore JavaScript by entering and running hundreds of code samples in Firebug, a free JavaScript debugger. Then in the last two chapters, you'll leave the safety of Firebug and hand-code an uber cool JavaScript application in your preferred text editor. Written in a friendly, engaging narrative style, this innovative JavaScript tutorial covers the following essentials: Core JavaScript syntax, such as value types, operators, expressions, and statements provided by ECMAScript. Features for manipulating XHTML, CSS, and events provided by DOM. Object-oriented JavaScript, including prototypal and classical inheritance, deep copy, and mixins. Closure, lazy loading, advance conditional loading, chaining, currying, memoization, modules, callbacks, recursion, and other powerful function techniques. Encoding data with JSON or XML. Remote scripting with JSON-P or XMLHttpRequest Drag-and-drop, animated scrollers, skin swappers, and other cool behaviors. Optimizations to ensure your scripts run snappy. Formatting and naming conventions to prevent you from looking like a greenhorn. New ECMAScript 5, DOM 3, and HTML 5 features such as Object.create(), Function.prototype.bind(), strict mode, querySelector(), querySelectorAll(), and getElementsByClassName(). As you can see, due to its fresh approach, this book is by no means watered down. Therefore, over the course of your journey, you will go from JavaScript beginner to wizard, acquiring the skills recruiters desire.
Title Page; Copyright Page; Dedication Page; Table of Contents; About the Author; About the Technical Reviewers; Acknowledgments; Preface; Opening Firebug; Enabling Firebug; Command Line; Command Editor; CHAPTER 1 Representing Data with Values; What Are Value Types?; Creating a String Literal; Commenting Code; Gluing Strings Together with the + Operator; Creating a Number Literal; Creating a Boolean Literal; Naming a Value with an Identifier; Can I Name a Variable Anything I Want?; Some Valid Identifiers Are Already Taken; Creating an Object Literal; Naming Members with Identifiers
Creating an Array LiteralCreating a Function Literal; Summary; CHAPTER 2 Type Conversion; String Members; Determining the Number of Characters; Decoding or Encoding Characters; Converting Case; Locating a Substring; Clipping a Substring; Replacing a Substring; Splitting a String into an Array of Smaller Strings; Searching with Regular Expressions; Explicitly Creating Wrappers; Converting a Value to Another Type; Converting a Value to a Number; Converting a Value to a String; Methods for Converting a Number to a String; Putting Off Learning RegExp Syntax; Summary; CHAPTER 3 Operators
Introducing Operator Precedence and AssociativityUsing JavaScript Operators; Combining Math and Assignment Operations; Incrementing or Decrementing Values; Testing for Equality; Testing for Inequality; Comparing Objects, Arrays, and Functions; Determining Whether One Number or String Is Greater Than; Determining Whether One Number or String Is Less Than Another; Greater Than or Equal to, Less Than or Equal to; Creating More Complex Comparisons; Saying or With ||; Saying "and" with &&; Chaining || Expressions; Chaining && Expressions; Chaining || and && Expressions
Conditionally Returning One of Two ValuesMaking Two Expressions Count as One; Deleting a Member, Element, or Variable; Summary; CHAPTER 4 Controlling Flow; Writing an if Condition; Appending an else Clause; To Wrap or Not to Wrap; Coding Several Paths with the else if Idiom; Controlling Flow with Conditional Expressions; Taking One of Several Paths with a Switch; Writing a while Loop; Aborting an Iteration but Not the Loop; Replacing Break with Return in a Function; Writing a do while loop; Writing a for Loop; Enumerating Members with a for in Loop; Snappier Conditionals; Snappier Loops
SummaryCHAPTER 5 Member Inheritance; Creating Objects with a Constructor; Classical Inheritance; Determining Which Type or Types an Object Is an Instance Of; Inherited Members Are Shared Not Copied; Modifying New and Past Instances of a Type; Sharing a Prototype but Forgoing the Chain; Adding an Empty Chain Link; Stealing a Constructor; Prototypal Inheritance; Cloning Members; Mixins; Summary; CHAPTER 6 Functions and Arrays; Why Use Functions?; Functions Are Values; Function Members; Conditional Advance Loading; Writing Object.defineProperty(); Writing Object.defineProperties()
Writing Object.create()
Includes index.
If you are new to both JavaScript and programming, this hands-on book is for you. Rather than staring blankly at gobbledygook, you'll explore JavaScript by entering and running hundreds of code samples in Firebug, a free JavaScript debugger. Then in the last two chapters, you'll leave the safety of Firebug and hand-code an uber cool JavaScript application in your preferred text editor. Written in a friendly, engaging narrative style, this innovative JavaScript tutorial covers the following essentials: Core JavaScript syntax, such as value types, operators, expressions, and statements provided by ECMAScript. Features for manipulating XHTML, CSS, and events provided by DOM. Object-oriented JavaScript, including prototypal and classical inheritance, deep copy, and mixins. Closure, lazy loading, advance conditional loading, chaining, currying, memoization, modules, callbacks, recursion, and other powerful function techniques. Encoding data with JSON or XML. Remote scripting with JSON-P or XMLHttpRequest Drag-and-drop, animated scrollers, skin swappers, and other cool behaviors. Optimizations to ensure your scripts run snappy. Formatting and naming conventions to prevent you from looking like a greenhorn. New ECMAScript 5, DOM 3, and HTML 5 features such as Object.create(), Function.prototype.bind(), strict mode, querySelector(), querySelectorAll(), and getElementsByClassName(). As you can see, due to its fresh approach, this book is by no means watered down. Therefore, over the course of your journey, you will go from JavaScript beginner to wizard, acquiring the skills recruiters desire.
Computer programming.
Software engineering.
Web Development.
Software Engineering/Programming and Operating Systems.