Your hands-on, step-by-step guide to the fundamentals of JavaScript development.
Teach yourself how to program with JavaScript -- one step at time. Ideal for developers with fundamental programming skills, this practical tutorial provides the clear guidance and hands-on examples you need to create or customize interactive Web applications using core JavaScript features and techniques.
Discover how to:
Write and deploy JavaScript code with Microsoft® Visual Studio® 2010, the Eclipse IDE, or text editors
Work with JavaScript syntax and data types
Use the Document Object Model to retrieve, create, and change HTML elements
Create rollover images and slideshow effects
Validate and provide feedback for user input on Web forms
Manipulate CSS styles and respond to browser events
Develop interactive Web applications using AJAX
Help speed development with JavaScript frameworks such as jQuery
Your Step by Step digital content includes:
All the books practice files -- ready to download and put to work.
Fully searchable online edition of this book -- with unlimited access on the Web.
The print version of this book includes free digital content online. To download, please visit O'Reilly's web site, search for the title of this book to find its catalog page, and click on the link below the cover image (Examples, Companion Content, or Practice Files). Note that while we provide as much of the media content as we are able via free download, we are sometimes limited by licensing restrictions. Please direct any questions or concerns to booktech@oreilly.com.
JavaWhat? The Where, Why, and How of JavaScript
Chapter 1 JavaScript Is More Than You Might Think
A Brief History of JavaScript
What’s in a JavaScript Program?
JavaScript Placement on Your Webpage
What JavaScript Can Do
What JavaScript Can’t Do
Tips for Using JavaScript
What’s New in ECMAScript Version 5?
Exercises
Chapter 2 Developing in JavaScript
JavaScript Development Options
Configuring Your Environment
Writing JavaScript with Visual Studio 2010
Writing JavaScript with Eclipse
Writing JavaScript Without an IDE
Debugging JavaScript
Exercises
Chapter 3 JavaScript Syntax and Statements
A Bit of Housekeeping
JavaScript Statements
Reserved Words in JavaScript
A Quick Look at Functions
JavaScript’s New Strict Mode
Exercises
Chapter 4 Working with Variables and Data Types
Data Types in JavaScript
Defining and Using Variables
Using the RegExp Object
Learning About Type Conversions
Exercises
Chapter 5 Using Operators and Expressions
Meet the Operators
Additive Operators
Multiplicative Operators
Bitwise Operators
Equality Operators
Relational Operators
Unary Operators
Assignment Operators
The Comma Operator
Exercises
Applying JavaScript
Chapter 6 Controlling Flow with Conditionals and Loops
If (and How)
Using else if and else Statements
Working with Ternary Conditionals
Testing with switch
Looping with while
Using for Loops
Validating Forms with Conditionals
Exercises
Chapter 7 Working with Functions
What’s in a Function?
Methods
A Look at Dialog Functions
Exercises
Chapter 8 Objects in JavaScript
Object-Oriented Development
Creating Objects
Finding Out More About Arrays
Taking Advantage of Built-in Objects
Exercises
Chapter 9 The Browser Object Model
Introducing the Browser
A Sense of Self
Getting Information About the Screen
Using the navigator Object
The location Object
The history Object
Exercises
Integrating JavaScript into Design
Chapter 10 The Document Object Model
The Document Object Model Defined
Retrieving Elements
Working with Attributes
Creating Elements
Deleting Elements
Exercises
Chapter 11 JavaScript Events and the Browser
Understanding Window Events
Detecting Visitor Information
Opening, Closing, and Resizing Windows
Timers
Exercises
Chapter 12 Creating and Consuming Cookies
Understanding Cookies
Creating Cookies with JavaScript
Reading Cookies with JavaScript
Removing Cookies
Exercises
Chapter 13 Working with Images in JavaScript
Working with Image Rollovers
Preloading Images
Working with Slideshows
Working with Image Maps
Exercises
Chapter 14 Using JavaScript with Web Forms
JavaScript and Web Forms
Obtaining Form Data
Working with Form Information
Prevalidating Form Data
Exercises
Chapter 15 JavaScript and CSS
What Is CSS?
The Relationship Between JavaScript and CSS
Exercises
Chapter 16 JavaScript Error Handling
Introducing Two Ways to Handle Errors
Using try/catch
Using the onerror Event
Exercises
AJAX and Server-Side Integration
Chapter 17 JavaScript and XML
Using XML with JavaScript
Working with XML Data from Excel 2007
A Preview of Things to Come
Exercises
Chapter 18 JavaScript Applications
Components of JavaScript Applications
JavaScript and Web Interfaces
Chapter 19 A Touch of AJAX
Introduction to AJAX
The XMLHttpRequest Object
Case Study: Live Searching and Updating
Exercises
Chapter 20 A Bit Deeper into AJAX
Creating an HTML Table with XML and CSS
Styling the Table with CSS
Creating a Dynamic Drop-Down Box
Accepting Input from the User and AJAX
Exercises
jQuery
Chapter 21 An Introduction to JavaScript Libraries and Frameworks
Understanding Programming Libraries
Defining Your Own JavaScript Library
Looking at Popular JavaScript Libraries and Frameworks
Steve Suehring is a technology architect who’s written about programming, security, network and system administration, operating systems, and other topics for several industry publications. He speaks at conferences and user groups and has served as an editor for a popular technology magazine.
Comments about Microsoft Press JavaScript Step by Step, 2nd Edition:
JavaScript is the backbone of any web application development, whether you're adding interactivity web form validating script to a web page or creating an entire JavaScript Ajax based application; JavaScript plays a vital role.
Learning JavaScript is a fun. JavaScript Step by Step is an introductory book which definitely helps you in Learning JavaScript. This book starts from basics of JavaScript web programming language. Small JavaScript exercise in this book always refreshes your learning. Good to start learning JavaScript.
1/27/2012
2.0
Disappointing
By michaelangellis
from London, United Kingdom
About Me Developer
Pros
Helpful examples
Cons
Not comprehensive enough
Too basic
Best Uses
Comments about Microsoft Press JavaScript Step by Step, 2nd Edition:
Author not enthusiastic for most part of the book and quite off-putting.
For a 'Step by Step book', the Author seem not have had a good thought about the varied background of such a book's audience. So many fundamental Programming concepts not taken into consideration and those mentioned are seldom explained - as one could expect, for example from a book such as 'Microsoft Visual C# 2010 Step by Step, by John Sharp'.
Book may suit audience with prior programming background but is new to JavaScript. Book covers a sensible amount of topics but still disappoints.
If you are new to programming avoid this book and if you are new to JavaScript but have prior programming background look elsewhere; this book at best is very average.
7/27/2011
(1 of 1 customers found this review helpful)
4.0
Great for programming beginners
By steven
from Los Angeles, CA
About Me Developer
Pros
Aimed at beginners
Easy to understand
Well-written
Cons
Pushes Microsoft tools
Best Uses
Novice
Comments about Microsoft Press JavaScript Step by Step, 2nd Edition:
When I first received the PDF copy of the 500+ page "JavaScript Step by Step," (Second Edition) by Steve Suehring, I was predisposed not to like it very much. It's a Microsoft Press book (released through O'Reilly), and I'm not much of a Microsoft person.
But Suehring's Javascript book -- aimed squarely at beginning programmers and not just Javascript beginners -- explains things that other books don't (especially in the valuable first 50 or so pages) and keeps you interested with a writing style more engaging than most. A good technical-book writer is a rarity, and I put Suehring in my top tier. And I read a lot of technical books.
I've spoken to a few coders about what languages a beginning programmer should learn. Which ones first, which language is "better" for a given task, and most seasoned hackers tell me that the more you work on code, the more you'll probably pick up new languages as you go along. It's the bones of programming itself that you need to learn. After that you learn a new programming language by picking up on the syntax that allows you to apply core programming concepts to a new environment.
And while many if not most coders have a favorite language in which to work, more often than not I've heard that it's a good idea to pick up Javascript while you're working on another language because most projects that have anything to do with the web need (or, at any rate, can really use) Javascript in addition to the other scripting language (Python, Perl, PHP, Ruby, etc) you're using to make everything come together.
There are very few programming books for beginners. Most of the O'Reilly books I see assume that you know some other programming language and, as I say above, just need to get up to speed in this new programming language.
But what about the person who knows nothing of loops, arrays, variables, strings, objects and the like?
"JavaScript Step By Step" is more than sensitive to the beginning programmer. That alone makes it more valuable to a huge segment of potential readers than many of the other Javascript how-to titles out there.
The Microsoft emphasis isn't as much of a problem as you might think. The book encourages use of MS development products like Visual Studio but neither mandates their use nor avoids mention of others, including the excellent Firebug extension for Firefox that I rely on in my development work as well as plain ol' text editors.
Suehring offers an introduction to AJAX and jQuery, but he doesn't base his book on use of the latter library. JQuery is important, but more important in my view is teaching beginners the core concepts of programming and Javascript itself.
If you're looking to go beyond tweaking HTML and CSS and want a gentle introduction to Javascript, Steve Suehring's "JavaScript Step by Step," is a fine place to start.
2/4/2011
(4 of 5 customers found this review helpful)
4.0
Very good for beginners
By Fale
from Milan, Italy
About Me Developer
Pros
Accurate
Easy to understand
Loads of exercises
Cons
Not for pro
Too Microsoft like
Best Uses
Intermediate
Novice
Student
Comments about Microsoft Press JavaScript Step by Step, 2nd Edition:
A Microsoft book. Probably, the first Microsoft book I've ever read. Leaving aside what I feel about Microsoft, I've been pretty impressed by this book. Even if it is a Microsoft production, sometimes you can see examples with Ecplise (a free software IDE) and I really enjoyed this. Also is outstanding the clearness of this book and the 'Step by Step' way of explaining.
The book is really a 'Step by Step' book, exactly as the title states. The book begins with very basic notions (like the language philosophy, the basic grammar) and it grow complexity step by step, passing through operatos, variables, expressions, control systems, blocks, DOM, AJAX and jQuery. The book has a lot of exercises, both right after a new concept is introduced and at the end of the chapter.
Is not surprising, but the last sections (AJAX and jQuery) are covered very lightly, and this make this book perfect for a novice, but not suitable for professional JavaScript programmers.
As I already said in the begin of this review, even if Eclipse is often used, the book is focused on Microsoft products (Visual Studio, Bing, Live Maps, etc) and this, in my opinion, is not so good, even if it was pretty probable, since is made by Microsoft.
1/21/2011
(2 of 3 customers found this review helpful)
4.0
JavaScript Step by Step Second Edition
By Shawn
from Dublin, Ireland
About Me Educator
Pros
Accurate
Concise
Easy to understand
Helpful examples
Well-paced
Well-written
Cons
One Companies Products
Best Uses
Novice
Student
Comments about Microsoft Press JavaScript Step by Step, 2nd Edition:
Yes, another tutorial based guide to JavaScript. Does the world need another one? Do you need another one? Well, it's made it to a second edition, there must be something to that. At least that was what made it worth checking out for me. In fact, after having spent some time with this volume, I come away very impressed. Suehring's JavaScript Step by Step in a superb 'missing manual' for novices and those already somewhat acquainted with aspects of JavaScript.
This is a well crafted guidebook that has clearly adopted a proven progression. A very basic introduction that familiarises someone new to JS with a couple handy development environments (Visual Studio and Eclipse - hey it's a Microsoft Press book what do you expect...at least an open source alternative was suggested), and moves to the basic grammar and the philosophy behind the language. It gradually builds on your working knowledge moving from syntax to operators and variables and then to expressions and control mechanisms. The approach is in very well constructed and steps are scoped and paced for an absolute beginner, but also allow someone with moderate experience to move quicker through the material and refresh their knowledge. Hands-on exercises are sprinkled throughout and the companion downloadable files allow you to avoid extensive typing and pick and choose where you really want to go hands-on. There are even specific exercises at the end of each section for those used to a little self-evaluation. All of which means that this book will suit a variety of learning styles.
The steps continue beyond the language basics to apply the building blocks of JavaScript into the important aspects of how it ties into the DOM and interacts with the browser - aspects that obviously are very much to the raison d'etre of JavaScript specifically. This builds into AJAX and Server-side integration, which was very much what I was most interested in seeing the handling of. For someone that played around with JavaScript in the more distant past, getting up to speed with how it is being used more recently (a wonderfully subjective reference ;-) is a real plus and I feel that Suehring accomplishes this well in this volume.
There are obvious limitations to how far one can go in an introductory (or even in a single) volume and exposure to the more advanced applications of JavaScript (Such as AJAX and JQuery) are more lightly handled, but enough of a taste to give the novice an basic understanding and at least know where to go next and be able to be more critically understand what is needed to know to move on, i.e. when shopping for the next volume of instruction.
The only critical issue I can raise, and it is more preferential than a defect, is the choice of Microsoft products largely exclusively, whether Visual Studio or integration with Bing and LiveMaps. All fine products and in widespread use. I do tip my hat to the suggestion of other OS products such as Eclipse, but am not used to seeing a volume aimed as particularly at a Microsoft-certified audience. Just me I suppose.
I am actually very impressed with this book and preceding comment aside I think this is a particularly notable volume for covering such a wide amount of information, in a very well considered and effective level of detail. For a novice to JavaScript, or someone that perhaps explored it within the last decade and wants to brush up on how it has been extended and functions well with new API's and frameworks, this is a great choice.