If you want to significantly expand your web development skills beyond PHP, this practical, hands-on book teaches you ECMAScript - the core JavaScript language - from the ground up. You'll discover some similarities between JavaScript and PHP, such as conditions and loops, but the primary focus is on JavaScript's unique object creation, classes, prototypes, and inheritance. JavaScript knowledge is essential for working with today's Web, whether you're building applications for the client, the server, or for mobile use - and your PHP experience gives you a head start. This book will help you…mehr
If you want to significantly expand your web development skills beyond PHP, this practical, hands-on book teaches you ECMAScript - the core JavaScript language - from the ground up. You'll discover some similarities between JavaScript and PHP, such as conditions and loops, but the primary focus is on JavaScript's unique object creation, classes, prototypes, and inheritance. JavaScript knowledge is essential for working with today's Web, whether you're building applications for the client, the server, or for mobile use - and your PHP experience gives you a head start. This book will help you become fluent with JavaScript quickly, and then serve as a handy reference once you start coding. Explore JavaScript syntax, including variables, arrays, loops, and conditions Learn how functions are important in JavaScript - and why they're actually objects Delve into JavaScript's object-oriented features, including prototypes, code reuse, and inheritance Examine the built-in API and explore its global functions, properties, and objects Learn about updates in ECMAScript5, the latest version of the standard Use common design patterns to organize your code in large applications
Stoyan Stefanov (http://phpied.com, @stoyanstefanov) is a Facebook engineer. Previously at Yahoo! he was the creator of the smush.it online image optimization tool and architect of YSlow 2.0. performance tool. Book author (JavaScript Patterns, Object-Oriented JavaScript), contributor (Even Faster Web Sites, High-Performance JavaScript) and speaker (Velocity, JSConf, Fronteers, Ajax Experience).
Inhaltsangabe
Acknowledgments Dedication Preface Conventions Used in This Book Using Code Examples Safari® Books Online How to Contact Us Chapter 1: Introduction 1.1 Scope of This Book 1.2 The Language 1.3 Learning Environment 1.4 Longer Examples 1.5 Let's Get Started Chapter 2: JavaScript Syntax 2.1 Variables 2.2 Values 2.3 Arrays 2.4 Conditions 2.5 while and for Loops 2.6 for-in Loops 2.7 Miscellaneous Operators Chapter 3: Functions 3.1 Default Parameters 3.2 Any Number of Arguments 3.3 arguments.length Trick 3.4 Return Values 3.5 Functions Are Objects 3.6 A Different Syntax 3.7 Scope 3.8 Hoisting 3.9 Closures 3.10 Scope Chain 3.11 Immediate Functions 3.12 Passing and Returning Functions Chapter 4: Object-Oriented Programming 4.1 Constructors and Classes 4.2 Prototypes 4.3 Object Literals 4.4 Fancy Arrays 4.5 Own Properties 4.6 Inheritance Chapter 5: The Built-In API 5.1 The Global Object 5.2 Global Properties 5.3 Global Functions 5.4 Built-In Constructors 5.5 Constructors Review Chapter 6: ECMAScript 5 6.1 Strict Mode 6.2 Property Attributes 6.3 New Object APIs 6.4 Array Additions 6.5 String Trimming 6.6 New in Date 6.7 Function.prototype.bind() 6.8 JSON 6.9 Shims Chapter 7: JavaScript Patterns 7.1 Private Properties 7.2 Revealing Pattern 7.3 Constants 7.4 Namespaces 7.5 Modules 7.6 CommonJS Modules 7.7 AMD 7.8 Design Patterns 7.9 Documentation and Testing Index Colophon