Pragmatic Guide to JavaScript

Pragmatic Guide to JavaScript

by Christophe Porteneuve
4.0 1


$20.38 $25.00 Save 18% Current price is $20.38, Original price is $25. You Save 18%.

Temporarily Out of Stock Online

Eligible for FREE SHIPPING


Pragmatic Guide to JavaScript by Christophe Porteneuve

JavaScript is everywhere. It's a key component of today's Web-a powerful, dynamic language with a rich ecosystem of professionalgrade development tools, infrastructures, frameworks, and toolkits. This book will get you up to speed quickly and painlessly with the 35 key JavaScript tasks you need to know.

The task-oriented two-page spreads get you up and running fast. The left pages explain the underlying implementation for each task, and the right pages contain code snippets for that task, along with cross-references to related tasks.

You'll learn essential JavaScript tasks in a framework-agnostic way. Learn How to manipulate the DOM and CSS, and how to use event handling and timers. You'll discover JavaScript tricks for user interface functionality: tooltips, lightboxes, image processing, infinite scrolling, and more. You'll work with forms for receiving and validating input and explore the client-server relationship with cookies, JSON, and Ajax, as well as mashups with Twitter, Flickr, and geo-related APIs. We round it off with a cheat sheet that gives you JavaScript at a glance.

Use this Pragmatic Guide to get started creating your own killer web applications, quickly and professionally.

Product Details

ISBN-13: 9781934356678
Publisher: Pragmatic Programmers, LLC, The
Publication date: 12/08/2010
Pages: 160
Product dimensions: 5.90(w) x 8.90(h) x 0.60(d)

About the Author

Christophe Porteneuve has been doing IT R&D for more than 10 years, specializing early in Web development. He joined Prototype Core in 2006, wrote Prototype and in 2007, and sometimes speaks at conferences such as The Ajax Experience. He's the CTO of in Paris, France, where he lives with his wife, Elodie.

Table of Contents

Dedication xi

Acknowledgments xiii

Introduction xv

What's This Book About, and Who Is It For? xv

This Book and JavaScript Libraries xvi

This Book at a Glance xvii

How to Read This Book xviii

I Bread and Butter: Pure JavaScript 1

Task 1 Dynamically Selecting a Method/Property 4

Task 2 Achieving Code Privacy with the Module Pattern 6

Task 3 Using Optional, Variable, and Named Arguments 8

II The DOM, Events, and Timers 11

Task 4 Obtaining References to DOM Elements 14

Task 5 Dynamically Styling Content 16

Task 6 Changing an Element's Contents 18

Task 7 Running Code When the DOM Is Loaded 20

Task 8 Listening for Events (and Stopping) 22

Task 9 Leveraging Event Delegation 24

Task 10 Decoupling Behaviors with Custom Events 26

Task 11 Simulating Background Processing 28

III UI Tricks 31

Task 12 Pulling Off Classy Tooltips 34

Task 13 Making Unobtrusive Pop-Ups 36

Task 14 Preloading Images 38

Task 15 Creating a Lightbox Effect 40

Task 16 Implementing an "Infinite Scroll" 42

Task 17 Maintaining Viewport When Loading Content 44

IV Form-fu 47

Task 18 Temporarily Disabling a Submit Button 50

Task 19 Providing Input Length Feedback 52

Task 20 (Un)checking a Whole Set of Checkboxes at Once 54

Task 21 Validating Forms: The Basics 56

Task 22 Validating Forms: Going Further 58

Task 23 Validating Forms: The Whole Nine Yards 60

Task 24 Providing On-the-Fly Help Tooltips on Forms 62

Task 25 Autocompleting Input As It's Typed 64

Task 26 Using Dynamic Multiple File Uploads 66

V Talking with the Server Side 69

Task 27 Reading/Writing Cookies 72

Task 28 Loading Stuff Through Ajax (Same Domain) 74

Task 29 Using JSON 76

Task 30 Using JSON-P 78

Task 31 Cross-Domain "Ajax" (Take 1) 80

Task 32 Cross-Domain "Ajax" (Take 2) 82

VI Making Mashups 85

Task 33 Syndicating Your Twitter Updates 88

Task 34 Syndicating Your Flickr Updates 90

Task 35 Geocoding a Location and Getting Photos For It 92

VII Appendices 95

A JavaScript Cheat Sheet 97

B Debugging JavaScript 101

B.1 Here Be Dragons 101

B.2 Firefox and Firebug 102

B.3 Safari and Web Inspector 106

B.4 IE6, IE7, the IE Toolbar, and Web Developer Express 108

B.5 IE8 and Developer Tools 111

B.6 Opera and Dragonfly 112

B.7 Virtual Machines Are Your Friends 113

B.8 The Network May Be Your Enemy 114

C JavaScript Frameworks 115

C.1 Prototype,, and Scripty2 116

C.2 jQuery and jQuery UI 117

C.3 MooTools 119

C.4 YUI 119

C.5 ExtJS 121

C.6 Dojo 122

D Getting Help 125

D.1 Help on JavaScript in General 125

D.2 Help on Frameworks 127

E Bibliography 131

Index 133

Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews

Pragmatic Guide to JavaScript 4 out of 5 based on 0 ratings. 1 reviews.
George_A More than 1 year ago
This book is written in a style that some people will like and others will not. It's a small book with less than 150 pages, so it is not a book for learning JavaScript. Don't pick this book as a beginner's guide to JavaScript or if you want a complete book on everything to do with JavaScript. The book gives a look at JavaScript at a glance. Showing examples of different aspects of JavaScript. What is good about the book is that most of the book is written with the left page as a discussion of the code on the opposite page. It makes for easy reading and lots of code examples. On the other hand, if looking at code and writing out code examples is not your cup of tea, you will not like this book. With only one page to discuss the code, don't expect in-depth discussions of the subject matter. In the section on working with DOM elements the author shows examples in several libraries (Prototype, jQuery, MooTools, YUI 3, Dojo) and discusses some of the differences. I found the book easy and quick to get though, the examples simple to understand and write.