JavaScript

  Author:    Peter-Paul Koch
  ISBN:    0321423305
  Sales Rank:    124389
  Published:    2006-06-20
  Publisher:    New Riders Press
  # Pages:    400
  Binding:    Paperback
  Avg. Rating:    5.0 based on 14 reviews
  Used Offers:    12 from $26.19
  Amazon Price:    $29.69
  (Data above last updated:  2008-09-06 06:05:36 EST)
  
  
Sort customer reviews by:
  
Show All Reviews on Page      Hide All Reviews on Page
   
  
JavaScript
  

Whether you're an old-school scripter who needs to modernize your JavaScripting skills or a standards-aware Web developer who needs best practices and code examples, you'll welcome this guide from a JavaScript master.

Other JavaScript books use example scripts that have little bearing on real-world Web development and are useful only in the chapter at hand. In contrast, Peter-Paul Koch's book uses eight real-world scripts he created for real-world clients in order to earn real-world money. That means the scripts are guaranteed to do something useful (and sellable!) that enhances the usability of the page they're used on.

The book's example scripts include one that sorts a data table according to the user's search queries, a form validation script, a script that shows form fields only when the user needs them, a drop-down menu, and a data retrieval script that uses simple Ajax and shows the data in an animation.

After an overview of JavaScript's purpose, Peter-Paul provides theoretical chapters on the context (jobs for JavaScript, CSS vs. JavaScript), the browsers (debugging, the arcana of the browser string), and script preparation. Then follow practical chapters on Core, BOM, Events, DOM, CSS Modification, and Data Retrieval, all of which are explained through a combination of theoretical instruction and the taking apart of the relevant sections of the example scripts.

                  Reader Reviews 1 - 14 of 14                 
  
  
Review
Date
Review
Rating(5 High)
Review
Helpful
to:
Customer Review Reviewer
Info
Permanent
Link
Reader Reviews Below Sorted by Newest First
08-28-08 5 (NA)
(Hide Review...)  One of my favorite books on JavaScript
Reviewer Permalink
I've been a fan of PPK's web site for sometime, and finally bought the book. I really like the way it's organized, and presents subjects within a project that will definitely improve your .js skills and the way you approach .js problems. I highly recommend it.
(Review Data Last Updated: 2008-09-05 06:10:52 EST)
03-26-08 3 (NA)
(Hide Review...)  Not a beginner's book
Reviewer Permalink
I bought this book because I was familiar with the author and his website, quirksmode. I figured this guy was a master of JavaScript and a book written from him would be a solid resource to learn from.

Well, I was half-right. Early on in the book he presents a script and says that you should know what it does before reading his book. Well, I knew what it was, but it's not the truth. This book is all about technique and execution. He shows innovative and great ways to implement code, but you have to know how to write javascript first. If you're not an experienced programmer or are unfamiliar with javascript, you may want to consider this book...after you've gotten a proven beginner's manual and gone through that first. Head First Javascript or Javascript in 21 days are good examples.
(Review Data Last Updated: 2008-08-29 05:30:01 EST)
02-17-08 4 (NA)
(Hide Review...)  From beginner to specialist
Reviewer Permalink
This book talks about scripting the DOM. Everything is clearly exposed : the history that make browsers like they are and not better, the tree behind an HTML document and the nodes behind tags and attributes, how to use css properties for the best, and how to manage events and their properties in all browsers, and of course the core of the javascript language.
There is nothing about objects and all other OOP stuff, so I think this book is very well suited for beginners. But specialist will also find a lot of interesting things.
One more advantage, the presentation and layout are really more pleasant than what is generally found in this category's books.
(Review Data Last Updated: 2008-03-27 03:48:56 EST)
08-28-07 5 (NA)
(Hide Review...)  Solidify your javascript foundation
Reviewer Permalink
Javascript has been around for a while but it is still going places. ppk on Javascript sorts through all the fluff to deliver rock solid information. The author is using a very clear language to express his deep experience in this field.

Javascript is moving fast and the book does not cover some of the recent advances like the rise of Ajax, ActionScript, Tamarin. It is still a must read for any serious (javascript) programmer.
(Review Data Last Updated: 2008-02-18 05:07:04 EST)
08-01-07 5 1\1
(Hide Review...)  Most thorough walk through JavaScript in a book
Reviewer Permalink
PPK on JavaScript by Peter-Paul Koch might just be the most thorough JavaScript book I have read. Through the use of eight real-world example scripts, PPK walks us through JavaScript from the very beginning. Over the years JavaScript has had its ups and downs. This is mainly due to the flux of poorly optimized scripts that are scattered around the Internet. So how do you know what source to trust? What are some best practices for JavaScript? How can you utilize JavaScript to add enhancements to your site without breaking in the browser? How can you create scripts that will enhance the user experience and not hurt it? All of these topics and more are discussed in this book.

Throughout the ten chapters and 499 pages of this book, there is very little that isn't covered on the topic. Let's take a look at the organization and flow of the book:

Purpose
This chapter paints the big picture for us. There is no jumping into scripts or coding in the first few chapters. Here we get an overview of some important aspects of JavaScript. One of the most important aspects is the coverage of the history of JavaScript. Though some might find this to be boring, I believe it to be invaluable. Understanding the history of JavaScript gives you a better idea of how it has formed into the language it is today. This is one of the most valuable parts of the book. It sets a solid foundation for everything else that is covered.

Context
Along with understanding the history, it is good to see where JavaScript fits into the big picture of web development. Here we take an in-depth look at HTML, CSS, and JavaScript. There are many distinctions to be made here as each could potentially mix with the other. It is important to keep a clean separation of your structure (HTML), presentation (CSS), and your behavior (JavaScript). At some points the line may become blurry on mixing the two, which is why each aspect is discussed in detail. These include separation of presentation and structure, separation of behavior and structure, and separation of behavior and presentation.

Not every user or device has JavaScript enabled. Moving forward we look at the impact on accessibility and how it affects things such as no mouse, screen readers, and usability. These are all important pieces that must be addressed as we begin adding advanced functionality to our website.

Lastly we are introduced to the eight example scripts that we will encounter: Textarea MaxLength, Usable Forms, Form Validation, Dropdown Menu, Edit Style Sheet, Sandwich Picker, XMLHTTP Speed Meter, and Site Survey.

Browsers
This chapter provides a little more context and history into the different browser families. We look not only at browsers but other devices such as mobile phones and screen readers. We look at each of these and are then shown some of the incompatibilities that they suffer. We address the problems and look to build solutions to patch the holes. Next we look at solving problems by using two different techniques: object detection and browser detection. Object detection works by checking if the methods you are using are supported before you use them. Browser detection tries to detect the current User Agent and then build from there. Browser detection has many flaws associated with it. One specifically is browser spoofing where you can send a different User Agent string to the server, lying to the application about the available technology. There are correct uses, but this should mostly be avoided.

If you have been developing JavaScript for a while then you are probably used to using the alert method to help in the debugging process. Here were are introduced to debugging, figuring out some of the cryptic messages returned by the browser, and how we can deal with browser bugs.

Preparation
Planning is important for all projects. Here we are introduced to preparing our application for enhancements. This involves having the proper placements of hooks. Hooks are found by using an ID, class, custom attributes (not a widely accepted solution), and name/value pairs.

Once we have our hooks in place, we have to get access to them to make our modifications. Having access is only part of the process. We also have to learn how to generate content when necessary and understanding the relationships inside of the DOM. We get a brief primer on setting up our script tag and how we can utilize multiple scripts if necessary.

Our hooks are in place, and we know where we want to apply our effects. How and when should they fire? We stop to take a look at the initialization of scripts and the load event. This method has its pitfalls, which are discussed and alternate solutions are addressed. We take a look back to the example scripts for some more insight and real-world use cases.

Core
Everything we have done to this point hinges on our ability to actually program the functionality we are trying to achieve. This section walks through the basics of programming in JavaScript. We look at statements, comments, code blocks, operators, values, and case sensitivity. Next we look at the six different data types that are available to us, and how JavaScript handles conversion and concatenation. We look at ways to explicitly convert our data types when necessary. After looking at the data types we look at some of the common operators. These are inherent to every programming language, so there isn't much new in this area. We've looked at the constructs, now we move to discussing variables: proper naming, the var keyword, and variable scope. This is very important to grasp as we move forward and create our own functions to achieve our tasks. Next we look at working with numbers, strings, and booleans inside of our scripts. We have a good foundation, now we move to control structures such as if, switch, for, while, do/while, break and continue, and try/catch. The next few sections focus on defining and working with custom functions, creating and defining objects and their methods and properties, and finally dealing with arrays. The section on arrays is especially helpful as it discussed how you can loop over them and how you can add, delete, and locate specific sections inside of an array.

BOM
This section looks at the Browser Object Model and the window object. We take a look at the global window object and its impact on creating new pages and cross communication between windows. We then look at navigation within the window and the location and history. We learn how to manipulate the geometry of the window, and how to retrieve information about the current window dimensions.

The chapter rounds off with discussion of some miscellaneous functions such as alert, confirm, prompt and timeouts and intervals. We take a closer look at some of the available methods for the document object. Finally, we take a look at working with cookies and utilizing/managing them within our application.

Events
This is probably one of the most important sections of this book. This section gives a thorough look at all of the available events. The chapter first starts by looking at some compatibilities and how to resolve them case by case. We take an in-depth look at all of the available events at our disposal and how they work. We look at event registration and the best way to handle it. The rest of this chapter discusses event bubbling and capturing and the browser support related to each, the event object and its properties available to us, targeting your elements, and then implementing some of our new-found knowledge in the example scripts. Sometimes grasping events and event registration can be tough, but this chapter makes it easy through illustration and the example scripts.

DOM
We have come a long way to this point. We have set our foundation, looked at the core of JavaScript, examined the browser window and its properties, and learned how to set our events in motion. Now it is time to look at the Document Object Model. The DOM holds all of the information inside of our pages. It is comprised of all elements and attributes and their relationship to one another. They are commonly referred to as nodes that build the family tree. Understanding of this structure is what gives us the power to build elements and insert them or delete them. We have full control over our internal structure.

However, it is never that easy. Traversing the DOM can sometimes be painful, especially when you see some of the differences between browsers. We take a look at how to find our nodes, how we can retrieve information about those nodes, and how we can change our document tree through appending, inserting, removing, and replacing. We are also introduced to creating elements and creating text nodes, and then how we can achieve some of the above tasks.

This chapter rounds off with the always heated discussion of the use of innerHTML, finding attributes and setting their values, dealing with text nodes - even empty text nodes that sometimes cause confusion, understanding and traversing the nodeLists, and dealing with forms and the Level 0 DOM. All of these pieces help us put together the big puzzle as we are using JavaScript to manipulate our pages.

CSS Modification
Earlier we discussed the aspect of keeping your presentation separate from your behavior. This chapter discusses best practices for working between the two. We learn how to get style information from our elements, and then how we can add classes dynamically. We take a brief look at the possibility of changing the entire stylesheet via JavaScript. While this is a nice introduction, I think it would require a specific project.

The last parts of this chapter look at some examples of keeping the clean separation, but applying some visual enhancements. We work through some examples of toggling display of elements, animating elements, and changing the dimensions and position of elements.

Data Retrieval
This chapter is all about AJAX. We look at the XMLHttpRequest object and how to make it work cross browser through some conditional checks. Once we have sent the request, we need to know how to handle the response. We look at the different statuses and response codes that we will be dealing with and how to set callback functions to handle the response. We look at the available return formats such as XML, HTML, JSON, and CSV. The final part to this chapter looks at the impact that AJAX has on accessibility.

This review alone does not do this book justice. This book thoroughly discussed each and every aspect to JavaScript, from its history to looking to its future. The example scripts helped to grasp the different concepts, but the real meat of the book was in the specific coverage of each aspect. There are many books about specific aspects of JavaScript, but this book combines them all into one resource. If you are just getting your feet wet in JavaScript, then this book is the perfect book to help take you to the next level.
(Review Data Last Updated: 2007-08-28 21:19:34 EST)
04-11-07 2 1\2
(Hide Review...)  Good website, bad book
Reviewer Permalink
PPK's website is probably the most authorative and up-to-date ressource on internet, but when it comes to JavaScript, one could not be less interesting. The book contains a few tips on accessibility but look no further.
(Review Data Last Updated: 2007-08-01 10:53:08 EST)
04-10-07 2 (NA)
(Hide Review...)  Good website, bad book
Reviewer Permalink
PPK's website is probably the most authorative and up-to-date ressource on internet, but when it comes to JavaScript, one could not be less interesting. The book contains a few tips on accessibility but look no further.
(Review Data Last Updated: 2007-04-11 11:07:03 EST)
02-06-07 5 1\2
(Hide Review...)  PPK makes Javascript readable
Reviewer Permalink
Good concise walkthrough of Javascript, it's structure, quirks and possibilities. Experienced programmers from other languages can pick up Javascript pretty quickly using ppk's descriptive style.
(Review Data Last Updated: 2007-07-04 14:58:04 EST)
01-19-07 3 7\10
(Hide Review...)  Less than I thought
Reviewer Permalink
I've been happily using ppk's website, quirksmode, for years. So when I saw his first book advertised on Amazon, I immediately pre-ordered it and waited anxiously for it to arrive. After reading through most it, I was really disappointed in its lack of more advanced topics.

Mr. Koch admits that the book doesn't cover every topic and is meant to address the real-world situations we web developers encounter. The problem is that, for JavaScript vets like me, I wanted this book to give me a deeper understanding of how using objects and, say, prototyping, could streamline the time it takes for me to write good, reusable code for my various projects. Sadly, none of these topics were covered. For a long book like this, it seems there was ample room to have covered these topics in some depth.

I would have given this book 2 stars, but ppk's writing style is very clear and understandable. Mr. Koch is a good teacher and shows a solid understanding of the concepts he's covered. Beginner and intermediate JavaScripters will find this book to be a nice reference with plenty of reusable code. For the more advanced, I imagine you'll discover the book's lack of depth as I have.
(Review Data Last Updated: 2007-07-04 14:58:04 EST)
01-15-07 5 0\1
(Hide Review...)  Excellent as a reference or as a guide.
Reviewer Permalink
This book is excellent!!! It can both guide you from a conceptual overview to a reference guide due to its real-world examples and up-to-date javascript technologies.
It was a worth reading.
(Review Data Last Updated: 2007-07-04 14:58:04 EST)
01-10-07 5 0\3
(Hide Review...)  Comprehensive
Reviewer Permalink
PPK covers everything you'd need to know to solve common problems using JavaScript. He uses examples from his career to illustrate the key concepts. PPK is a great writer and the book is a very easy read.
(Review Data Last Updated: 2007-07-04 14:58:04 EST)
01-09-07 5 1\1
(Hide Review...)  one of the better javascript books
Reviewer Permalink
I would group this book with The Javascript Anthology and The Complete Reference Javascript - all three should be on your bookshelf. The Anthology because it is current and has a lot of solutions to current problems. The Reference because it is the bible of javascript and ppk because it well thought out with many good examples.

The only drawback to ppk is the use of the author's real-world scripts. He suggests you check them out beforehand on his excellent and timely web site, [....] The scripts are good but never printed out completely in the book. That said, there is enough information in this book that you'll reference it over and over.
(Review Data Last Updated: 2007-07-04 14:58:04 EST)
12-31-06 5 (NA)
(Hide Review...)  ppk on JavaScript
Reviewer Permalink
Found a lot of interesting bits and pieces in this book that complement or reference the author's excellent [...] web site. Wouldn't recommend this book as a general tutorial or reference, but for filling gaps with important but little known facts. The author puts a lot of emphasis on doing things "the right way", but he always remains pragmatic (e.g. by not refusing to use the "innerHTML" property).
(Review Data Last Updated: 2007-01-09 14:35:15 EST)
10-30-06 5 6\6
(Hide Review...)  fills a void
Reviewer Permalink
"ppk on JavaScript" fills an interesting void with the focus of today's JavaScript books. Most books either focus on "JavaScript in 21 Days", "JavaScript - Complete Reference" or "AJAX". This book covers techniques for creating clean and accessible JavaScript functionality.

The book's stated audience is someone who knows at least some JavaScript - a beginning level or up. Basically, you should feel comfortable reading and understanding code. I think the book might be a little overwhelming for a beginner to understand. A beginner could read it twice - once right away and once after reading another JavaScript book.

The author views JavaScript as a technique to add usability. He shows how to create "unobtrusive" JavaScript. In other words, the JavaScript stays out of the HTML page and the page works without JavaScript, albeit with less functionality.

Eight case studies (real life examples) are used throughout the book. The author points out why he selected certain techniques. He also notes bugs and where he would have done things differently. I particularly liked the emphasis on separation of concerns.

Keyboard users are also discussed from an accessibility point of view in several chapters. In other chapters, only users without JavaScript enabled were discussed. I would have liked a little more consistency with how accessibility was treated.

Overall, the book was very good. The tips were useful and I enjoyed the emphasis on design. And AJAX is discussed from the point of view of how it was used before it was called AJAX.
(Review Data Last Updated: 2007-01-02 15:39:09 EST)
  
                  Reader Reviews 1 - 14 of 14                 
  
  
  
  
  
  

Because the data used to generate this site come from outside sources, VeryWellSaid.com cannot guarantee the completeness or accuracy of the data.
Search VeryWellSaid™
Google
Web VeryWellSaid™
New subjects are added every week.
View Subjects Below by:
* Top Selling
 (click category name, left)
* Top-Rated Top Sellers
 (click 'Top Rated', right)
In the news...  
Dubai\UAE Top Rated
Influenza\Bird Flu Top Rated
Iraq Top Rated
Supreme Court Top Rated
All Books Top Rated
Arts Top Rated
Photography Top Rated
Digital Photography Top Rated
Digital Cameras Top Rated
Biography Top Rated
Business Top Rated
Management Top Rated
Marketing Top Rated
Sales Top Rated
Stocks Top Rated
Bonds Top Rated
Real Estate Top Rated
Trading Top Rated
Commodities Trading Top Rated
Time Management Top Rated
Starting A Business Top Rated
Children's Top Rated
Comics Top Rated
Computers Top Rated
PC Top Rated
Mac Top Rated
Programming Top Rated
Design Patterns Top Rated
.Net Top Rated
C# Top Rated
Vb.Net Top Rated
Asp.Net Top Rated
Java Top Rated
Python Top Rated
PHP Top Rated
Perl Top Rated
Javascript Top Rated
Ajax Top Rated
CSS Top Rated
Open Source Top Rated
SQL Top Rated
Databases Top Rated
Oracle Top Rated
MySql Top Rated
Sql Server Top Rated
IIS Top Rated
Apache Top Rated
Linux Top Rated
Windows Server Top Rated
Project Management Top Rated
HTML Top Rated
UML Top Rated
IT Certifications Top Rated
Cisco Certifications Top Rated
MCSE Top Rated
MCSD Top Rated
Cooking Top Rated
Italian Cooking Top Rated
Vegetarian Cooking Top Rated
Wine Top Rated
Engineering Top Rated
Entertainment Top Rated
Health Top Rated
Nutrition Top Rated
Dieting Top Rated
Sex Top Rated
History Top Rated
Military History Top Rated
British History Top Rated
Middle East History Top Rated
Land Battles Top Rated
Naval Warfare Top Rated
Air Warfare Top Rated
9/11 Top Rated
Terrorism Top Rated
Home Top Rated
Mortgage\Home Equity Loan Top Rated
Cars Top Rated
Car Buying Top Rated
Sports Cars Top Rated
Cat Top Rated
Humor Top Rated
Horror Top Rated
Law Top Rated
IP Law Top Rated
Legal History Top Rated
Fiction Top Rated
Oprah's Book Club Top Rated
Medicine Top Rated
Cancer Top Rated
Stroke Top Rated
Heart Disease Top Rated
Fertility Top Rated
Diabetes Top Rated
Pharmacology Top Rated
Back Problems Top Rated
Menopause Top Rated
Thyroid Top Rated
Pain Top Rated
Organic Chemistry Top Rated
Immune System Top Rated
Mystery Top Rated
Nonfiction Top Rated
Outdoors Top Rated
Running Top Rated
Radio Control Models Top Rated
Guns Top Rated
Parenting Top Rated
Divorce Top Rated
Professional Top Rated
Reference Top Rated
Religion Top Rated
Romance Top Rated
Science Top Rated
Physics Top Rated
Chemistry Top Rated
Astronomy Top Rated
Psychology Top Rated
Science Fiction Top Rated
Sports Top Rated
Teens Top Rated
Travel Top Rated
USA Top Rated
Europe Top Rated
France Top Rated
Italy Top Rated
England Top Rated
China Top Rated
All Books Arts Biography Click Here For An A-Z Index Of All 213 Best-Seller Subjects Business Children's Comics
Computers Cooking Engineering Entertainment Health History Home Horror Humor Law Fiction Medicine Mystery
Nonfiction Outdoors Parenting Professional Reference Religion Romance Science Sci-Fi Sports Teens Travel
In Association with Amazon.com

Cache miss
(not cached)