Pragmatic Guide to JavaScript.pdf
(
2190 KB
)
Pobierz
What Readers Are Saying About
Pragmatic Guide to JavaScript
I wish I had owned this book when I first started out doing JavaScript!
Prag-
matic Guide to JavaScript
will take you a big step ahead in programming
real-world JavaScript by showing you what is going on behind the scenes in
popular JavaScript libraries and giving you no-nonsense advice and back-
ground information on how to do the right thing. With the condensed years
of experience of one of the best JavaScript developers around, it’s a must-
read with great reference to everyday JavaScript tasks.
Thomas Fuchs
Creator of the script.aculo.us framework
An impressive collection of very practical tips and tricks for getting the most
out of JavaScript in today’s browsers, with topics ranging from fundamen-
tals such as form validation and JSON handling to application examples
such as mashups and geolocation. I highly recommend this book for anyone
wanting to be more productive with JavaScript in their web applications.
Dylan Schiemann
CEO at SitePen, cofounder of the Dojo Toolkit
There are a number of JavaScript books on the market today, but most of
them tend to focus on the new or inexperienced JavaScript programmer.
Porteneuve does no such thing, and this Pragmatic Guide is a better book
for it. If you’re a novice, go elsewhere first, and then when you have some
scripting under your belt, come back; if you’ve worked with JavaScript
before, then
Pragmatic Guide to JavaScript
takes a set of techniques that
you may have heard about or seen and makes them useful to you. Recom-
mended.
Stuart Langridge
kryogenix.org, @sil
Pragmatic Guide to JavaScript
Christophe Porteneuve
Raleigh, North Carolina Dallas, Texas
The Pragmatic Bookshelf
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in this book, and The Pragmatic Pro-
grammers, LLC was aware of a trademark claim, the designations have been printed in initial
capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic
Programming, Pragmatic Bookshelf and the linking
g
device are trademarks of The Pragmatic
Programmers, LLC.
Every precaution was taken in the preparation of this book. However, the publisher assumes no
responsibility for errors or omissions, or for damages that may result from the use of information
(including program listings) contained herein.
Our Pragmatic courses, workshops, and other products can help you and your team create better
software and have more fun. For more information, as well as the latest Pragmatic titles, please
visit us at
http://www.pragprog.com.
The team that produced this book includes:
Editor:
Indexing:
Copy edit:
Layout:
Production:
Customer support:
International:
David McClintock
Potomac Indexing, LLC
Kim Wimpsett
Steve Peter
Janet Furlow
Ellie Callahan
Juliet Benda
Copyright © 2010 Pragmatic Programmers, LLC.
All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any
form, or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the
prior consent of the publisher.
Printed in the United States of America.
ISBN-10: 1-934356-67-0
ISBN-13: 978-1-934356-67-8
Printed on acid-free paper.
Version: 2010-11-18
P1.0 printing, November 2010
Contents
Dedication
Acknowledgments
Introduction
What’s This Book About, and Who Is It For?
This Book and JavaScript Libraries
. . . . . .
This Book at a Glance
. . . . . . . . . . . . .
How to Read This Book
. . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
9
10
12
12
13
14
15
I
Bread and Butter: Pure JavaScript
Task 1. Dynamically Selecting a Method/Property
Task 2. Achieving Code Privacy with the Module Pattern
Task 3. Using Optional, Variable, and Named Arguments
16
18
20
22
II
The DOM, Events, and Timers
Task 4. Obtaining References to DOM Elements
Task 5. Dynamically Styling Content
Task 6. Changing an Element’s Contents
Task 7. Running Code When the DOM Is Loaded
Task 8. Listening for Events (and Stopping)
Task 9. Leveraging Event Delegation
Task 10. Decoupling Behaviors with Custom Events
Task 11. Simulating Background Processing
24
26
28
30
32
34
36
38
40
Plik z chomika:
musli_com
Inne pliki z tego folderu:
JavaScript_ The Missing Manual [McFarland 2008-07-01].pdf
(21906 KB)
Professional jQuery [Otero 2012-05-01].pdf
(24031 KB)
Smashing Node.js_ JavaScript Everywhere [Rauch 2012-09-04].pdf
(16688 KB)
Practical Dojo Projects [Zammetti 2008-09-24].pdf
(7145 KB)
Beginning JavaScript (5th ed.) [McPeak & Wilton 2015-03-09].pdf
(37093 KB)
Inne foldery tego chomika:
3D Design - Programming
ActionScript
Actionscript - Flash - Flex - Air
Ada
ADO
Zgłoś jeśli
naruszono regulamin