04.11.2015 Views

javascript

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Contents<br />

Chapter 6: Object-Oriented Programming 151<br />

Creating Objects 151<br />

The Factory Pattern 152<br />

The Constructor Pattern 152<br />

The Prototype Pattern 155<br />

Combination Constructor/Prototype Pattern 166<br />

Dynamic Prototype Pattern 166<br />

Parasitic Constructor Pattern 167<br />

Durable Constructor Pattern 169<br />

Inheritance 170<br />

Prototype Chaining 170<br />

Constructor Stealing 175<br />

Combination Inheritance 176<br />

Prototypal Inheritance 177<br />

Parasitic Inheritance 178<br />

Parasitic Combination Inheritance 179<br />

Summary 182<br />

Chapter 7: Anonymous Functions 183<br />

Recursion 184<br />

Closures 185<br />

Closures and Variables 188<br />

The this Object 189<br />

Memory Leaks 190<br />

Mimicking Block Scope 191<br />

Private Variables 193<br />

Static Private Variables 195<br />

The Module Pattern 196<br />

The Module-Augmentation Pattern 198<br />

Summary 199<br />

Chapter 8: The Browser Object Model 201<br />

The window Object 201<br />

The Global Scope 201<br />

Window Relationships and Frames 202<br />

Window Position 205<br />

Window Size 206<br />

Navigating and Opening Windows 207<br />

Intervals and Timeouts 211<br />

System Dialogs 213<br />

xviii

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!