JavaScript in 24 Hours, Sams Teach Yourself, Barnes & Noble Exclusive Edition

JavaScript in 24 Hours, Sams Teach Yourself, Barnes & Noble Exclusive Edition

by Phil Ballard


$31.49 $34.99 Save 10% Current price is $31.49, Original price is $34.99. You Save 10%.
View All Available Formats & Editions
Choose Expedited Shipping at checkout for guaranteed delivery by Wednesday, February 27

Product Details

ISBN-13: 9780672337482
Publisher: Sams
Publication date: 06/25/2015
Series: Sams Teach Yourself Series
Pages: 448
Sales rank: 427,017
Product dimensions: 6.90(w) x 9.00(h) x 1.00(d)

About the Author

Phil Ballard, the author of various Sams Teach Yourself titles, graduated in 1980 with an honors degree in electronics from the University of Leeds, England. Following an early career as a research scientist with a major multinational, he spent a few years in commercial and managerial roles within the high technology sector, later working full time as a software engineering consultant. Operating as “The Mouse Whisperer” ( ), Ballard has spent recent years involved solely in website and intranet design and development for an international portfolio of clients, as well as writing numerous technical books and articles.

Table of Contents

Part I: First Steps with JavaScript

HOUR 1: Introducing JavaScript

Web Scripting Fundamentals

Server- Versus Client-Side Programming

JavaScript in a Nutshell

Where JavaScript Came From

The Script Tag

Introducing the DOM

Talking to the User

HOUR 2: Writing Simple Scripts

Including JavaScript in Your Web Page

JavaScript Statements



Capturing Mouse Events

HOUR 3: Using Functions

General Syntax

Calling Functions

Passing Arguments to Functions

Returning Values from Functions

Scope of Variables

HOUR 4: DOM Objects and Built-in Objects

Interacting with the User

Selecting Elements by Their ID

Accessing Browser History

Using the location Object

Browser Information–The navigator Object

Dates and Times

Simplifying Calculation with the Math Object

Part II: Cooking with Code

HOUR 5: Numbers and Strings



Boolean Values

HOUR 6: Arrays


HOUR 7: Program Control

Conditional Statements

Loops and Control Structures

Setting and Using Timers

Part III: Objects

HOUR 8: Object-Oriented Programming

What Is Object-Oriented Programming?

Object Creation

Extending and Inheriting Objects Using prototype


Using Feature Detection

HOUR 9: Scripting with the DOM

DOM Nodes

Selecting Elements with getElementsByTagName()

Reading an Element’s Attributes

Mozilla’s DOM Inspector

HOUR 10: Meet JSON

What Is JSON?

Accessing JSON Data

Data Serialization with JSON

JSON Data Types

Simulating Associative Arrays

Creating Objects with JSON

JSON Security

Part IV: HTML and CSS

HOUR 11: JavaScript and HTML5

New Markup for HTML5

Some Important New Elements

Drag and Drop

Local Storage

Working with Local Files

HOUR 12: JavaScript and CSS

A Ten-Minute CSS Primer

The DOM style Property

Accessing Classes Using className

The DOM styleSheets Object

HOUR 13: Introducing CSS3

Vendor-Specific Properties and Prefixes

CSS3 Borders

CSS3 Backgrounds

CSS3 Gradients

CSS3 Text Effects

CSS3 Transitions, Transformations, and Animations

Referencing CSS3 Properties in JavaScript

Setting CSS3 Properties with Vendor Prefixes

Part V: Using JavaScript Libraries

HOUR 14: Using Libraries

Why Use a Library?

What Sorts of Things Can Libraries Do?

Some Popular Libraries

Introducing prototype.js

HOUR 15: A Closer Look at jQuery

Including jQuery in Your Pages

jQuery’s $(document).ready Handler

Selecting Page Elements

Working with HTML Content

Showing and Hiding Elements

Animating Elements

Command Chaining

Handling Events

HOUR 16: The jQuery UI User Interface Library

What jQuery UI Is All About

How to Include jQuery UI in Your Pages


Using Widgets

HOUR 17: Ajax with jQuery

The Anatomy of Ajax

Using jQuery to Implement Ajax

Part VI: Advanced Topics

HOUR 18: Reading and Writing Cookies

What Are Cookies?

The document.cookie Property

Cookie Ingredients

Writing a Cookie

A Function to Write a Cookie

Reading a Cookie

Deleting Cookies

Setting Multiple Values in a Single Cookie

HOUR 19: Coming Soon to JavaScript


Arrow Functions


Using let and const

Template Strings

Access Arrays with for-of


HOUR 20: Using Frameworks

Software Frameworks

Model-View-Controller (MVC) Architecture

Using an MVC Framework for Web Apps

The AngularJS Framework

Building an AngularJS Application

HOUR 21: JavaScript Beyond the Web Page

JavaScript Outside the Browser

Writing Google Chrome Extensions

Going Further

Part VII: Learning the Trade

HOUR 22: Good Coding Practice

Don’t Overuse JavaScript

Writing Readable and Maintainable Code

Graceful Degradation

Progressive Enhancement

Unobtrusive JavaScript

Feature Detection

Handling Errors Well

HOUR 23: Debugging Your Code

An Introduction to Debugging

More Advanced Debugging

HOUR 24: JavaScript Unit Testing

What Is Unit Testing?

Writing JavaScript for Unit Testing

The QUnit Test Suite

Part VIII: JavaScript Game Programming (Barnes & Noble Exclusive Edition Only)

HOUR 25: Writing Minecraft Mods in JavaScript

What Is a Minecraft Mod?

Setting Up a CanaryMod Server

“Modolith” — Your First Minecraft Mod

The ScriptCraft Drone

Creating a JS Plug-in in ScriptCraft

Programming with Events

HOUR 26: Game Programming Using EaselJS

Introducing EaselJS

The Stage

Rendering a Canvas

Animating an Image

Part VIII: Appendices

APPENDIX A: Tools for JavaScript Development



Debugging and Verifying Tools

APPENDIX B: JavaScript Quick Reference

Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews