Heilmann | Beginning JavaScript with DOM Scripting and Ajax | E-Book | www2.sack.de
E-Book

E-Book, Englisch, 512 Seiten

Heilmann Beginning JavaScript with DOM Scripting and Ajax

From Novice to Professional
1. ed
ISBN: 978-1-4302-0184-7
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark

From Novice to Professional

E-Book, Englisch, 512 Seiten

ISBN: 978-1-4302-0184-7
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark



This is the most up-to-date book on JavaScript available, covering current standards, techniques, and practices. It provides all you need to know to hit the ground running, without making you trawl through hundreds of pages of syntax. The book contains multiple chapters on Ajax and DOM Scripting, which are two of the hottest web development and design tools available today. Using a pragmatic and thorough approach, the book ensures that even the most novice JavaScript programmers will become familiar and comfortable using the tools presented.

Christian Heilmann grew up in Germany and, after a year working with people with disabilities through the Red Cross, he spent a year as a radio producer. Beginning in 1997, he worked for several agencies in Munich as a web developer. In 2000, he moved to the U.S. to work for eToys and, after the dot-com crash, he moved to the U.K., where he currently works as a lead developer for Agilisys. He publishes an almost-daily blog at http://wait-till-i.com and runs an article repository at http://icant.co.uk. He is a member of the Web Standards Project's DOM Scripting Task Force.

Heilmann Beginning JavaScript with DOM Scripting and Ajax jetzt bestellen!

Autoren/Hrsg.


Weitere Infos & Material


1;Contents;6
2;Foreword;12
3;About the Author;13
4;About the Technical Reviewer;14
5;Acknowledgments;15
6;Introduction;16
7;Chapter 1 Getting Started with JavaScript;19
7.1;The Why of JavaScript;21
7.2;What Is JavaScript?;22
7.3;Problems and Merits of JavaScript;23
7.4;Why Use JavaScript If It Cannot Be Relied On?;24
7.5;JavaScript in a Web Page and Essential Syntax;25
7.5.1;JavaScript Syntax;26
7.5.2;Code Execution;27
7.5.3;An Aside About Functions;29
7.6;Objects;30
7.7;Simple JavaScript Example;31
7.8;Summary;34
8;Chapter 2 Data and Decisions;35
8.1;Data, Data Types, and Data Operators;36
8.1.1;The String Data Type;36
8.1.2;Operators;39
8.1.3;JavaScript Variables;41
8.1.4;Converting Different Types of Data;44
8.2;The Composite Data Types: Array and Object;48
8.2.1;Objects JavaScript Supplies You with: String, Date, and Math;48
8.3;Arrays;57
8.3.1;The Array Object’s Methods and Properties;60
8.4;Making Decisions in JavaScript;63
8.4.1;The Logical and Comparison Operators;63
8.4.2;Conditional Statements;67
8.4.3;Testing Multiple Values: the switch Statement;70
8.4.4;Repeating Things: Loops;72
8.5;Summary;77
9;Chapter 3 From DHTML to DOM Scripting;78
9.1;JavaScript As “the Behavior Layer”;80
9.1.1;Object Detection vs. Browser Dependence;82
9.1.2;Progressive Enhancement;85
9.2;JavaScript and Accessibility;86
9.3;Good Coding Practices;88
9.3.1;Naming Conventions;88
9.3.2;Code Layout;89
9.3.3;Commenting;91
9.3.4;Functions;93
9.3.5;Short Code via Ternary Operator;96
9.3.6;Sorting and Reuse of Functions;97
9.3.7;Variable and Function Scope;97
9.3.8;Keeping Scripts Safe with the Object Literal;98
9.4;Summary;100
10;Chapter 4 HTML and JavaScript;102
10.1;The Anatomy of an HTML Document;102
10.2;Providing Feedback in Web Pages via JavaScript: The Old School Ways;106
10.2.1;Using window Methods: prompt(), alert(), and confirm();107
10.3;Accessing the Document via the DOM;113
10.4;Of Children, Parents, Siblings, and Values;116
10.4.1;From the Parents to the Children;117
10.4.2;From the Children to the Parents;119
10.4.3;Among Siblings;120
10.5;Changing Attributes of Elements;124
10.6;Creating, Removing, and Replacing Elements;126
10.6.1;Avoiding NOSCRIPT;130
10.6.2;Shortening Your Scripts via InnerHTML;132
10.6.3;DOM Summary: Your Cheat Sheet;133
10.6.4;DOMhelp: Our Own Helper Library;135
10.7;Summary;139
11;Chapter 5 Presentation and Behavior (CSS and Event Handling);140
11.1;Changing the Presentation Layer via JavaScript;140
11.1.1;Helping the CSS Designer;148
11.2;Changing the Document’s Behavior via Event Handling;170
11.2.1;Events in the W3C-Compliant World;173
11.2.2;Fixing Events for the Non-W3C-Compliant World;182
11.2.3;Never Stop Optimizing;189
11.2.4;The Ugly Page Load Problem and Its Ugly Solutions;190
11.2.5;Reading and Filtering Keyboard Entries;191
11.2.6;The Dangers of Event Handling;196
11.3;Summary;197
12;Chapter 6 Common Uses of JavaScript: Images and Windows;199
12.1;Images and JavaScript;199
12.1.1;Basics of Image Scripting;200
12.1.2;Preloading Images;202
12.1.3;Rollover Effects;203
12.1.4;Slide Shows;212
12.1.5;Summary of Images and JavaScript;227
12.2;Windows and JavaScript;228
12.2.1;Window Properties;229
12.2.2;Window Methods;231
12.2.3;Summary: Windows and JavaScript;254
12.3;Summary;255
13;Chapter 7 JavaScript and User Interaction: Navigation and Forms;256
13.1;Navigation and JavaScript;256
13.1.1;The Fear of the Page Reload;257
13.1.2;Basics of Navigation and JavaScript;257
13.1.3;Browser Navigation;260
13.1.4;In-Page Navigation;261
13.1.5;Site Navigation;270
13.1.6;Pagination;278
13.1.7;Summary of Navigation with JavaScript;287
13.2;Forms and JavaScript;287
13.2.1;Basics of Forms with JavaScript;289
13.2.2;Form Elements;290
13.2.3;Interactive Forms: Hiding and Showing Dependent Elements;306
13.2.4;Custom Form Elements;312
13.2.5;Summary of Forms and JavaScript;312
13.3;Summary;312
14;Chapter 8 Back-End Interaction with Ajax;314
14.1;Household Cleaning Liquid, Football Club, or Flash Gordon’s Spacecraft: What Is Ajax?;315
14.2;Et Tu, Cache?;324
14.3;Putting the X Back into Ajax;324
14.3.1;Replacing XML with JSON;329
14.3.2;Using Server-Side Scripts to Reach Third-Party Content;331
14.3.3;XHR on Slow Connections;335
14.3.4;A Larger Ajax Example: Connected Select Boxes;338
14.3.5;Optional Dynamic Ajax Menus;346
14.4;Summary;355
15;Chapter 9 Data Validation Techniques;357
15.1;Pros and Cons of Client-Side JavaScript Validation;357
15.2;A Quick Reminder About Protecting Content with JavaScript;358
15.3;The One-Size-Fits-All Validation Myth;359
15.4;Basic JavaScript Validation with String and Numeric Methods;360
15.4.1;String Validation Methods;360
15.4.2;Numeric Validation Methods;366
15.5;Regular Expressions;371
15.5.1;Syntax and Attributes;371
15.5.2;Wildcard Searches, Constraining Scope, and Alternatives;372
15.5.3;Restricting the Number of Characters with Quantifiers;373
15.5.4;Word Boundaries, Whitespace, and Other Shortcuts;374
15.5.5;Methods Using Regular Expressions;375
15.5.6;The Power of Parenthesis Grouping;375
15.5.7;Regular Expression Resources;377
15.6;Summary of Validation Methods;377
15.7;Form Validation Techniques;378
15.7.1;Designating Mandatory Fields;378
15.7.2;The Hidden Field Method;378
15.7.3;The Indicator Element Method;379
15.7.4;The CSS Classes Method;380
15.7.5;The Custom Attribute Method;380
15.7.6;Failures of These Methods;381
15.7.7;Sharing Validation Rules;381
15.8;Giving Users Validation Feedback;383
15.8.1;Showing a List of Erroneous Fields;383
15.8.2;Replacing the Main Form with a Clickable Error Message;388
15.8.3;Instant Validation Feedback;393
15.9;Other Dynamic Validation Methods;395
15.10;Summary;399
16;Chapter 10 Modern JavaScript Case Study: A Dynamic Gallery;400
16.1;Basics of Thumbnail Galleries;400
16.2;What Is a Thumbnail Gallery and What Should It Do?;401
16.3;Static Thumbnail Galleries;401
16.4;Faking Dynamic Galleries with JavaScript;402
16.5;Displaying Captions;409
16.6;Dynamic Thumbnail Galleries;414
16.7;Creating an Image Badge from a Folder;419
16.8;Summary;427
17;Chapter 11 Using Third-Party JavaScript;428
17.1;What the Web Offers You;428
17.2;Code Snippets, RSS Feeds, APIs, and Libraries;429
17.2.1;RSS Feeds and REST APIs;430
17.2.2;Examples of REST APIs;431
17.3;Using a Library: Short, Shorter, jQuery;432
17.3.1;Dangers of jQuery and Other Libraries Using Their Own Syntax;439
17.4;Using an API: Adding a Map to Your Site with Google Maps;440
17.5;Full Service: The Yahoo Developer Network and User Interface Library;451
17.5.1;Bouncy Headlines Using YUI;452
17.5.2;Replacing Pop-Up Windows Using the YUI Connection Manager and Container Components;457
17.5.3;Yahoo User Interface Library Summary;462
17.6;Summary;463
18;APPENDIX Debugging JavaScript;464
18.1;Common JavaScript Mistakes;464
18.1.1;Misspellings and Case-Sensitivity Issues;464
18.1.2;Trying to Access Undefined Variables;465
18.1.3;Incorrect Number of Closing Braces and Parentheses;467
18.1.4;Concatenation Gone Wrong;469
18.2;Tracing Errors with alert() and“Console” Elements;471
18.3;Error Handling with try and catch();472
18.4;Sequential Uncommenting;475
18.5;Error Reporting in Browsers;476
18.5.1;Microsoft Internet Explorer 6;476
18.5.2;Safari;477
18.5.3;Opera 8.5;479
18.5.4;Firefox 1.5.0.3;479
18.6;JSLint and JSUNIT;483
18.7;Summary;483
19;Index;484



Ihre Fragen, Wünsche oder Anmerkungen
Vorname*
Nachname*
Ihre E-Mail-Adresse*
Kundennr.
Ihre Nachricht*
Lediglich mit * gekennzeichnete Felder sind Pflichtfelder.
Wenn Sie die im Kontaktformular eingegebenen Daten durch Klick auf den nachfolgenden Button übersenden, erklären Sie sich damit einverstanden, dass wir Ihr Angaben für die Beantwortung Ihrer Anfrage verwenden. Selbstverständlich werden Ihre Daten vertraulich behandelt und nicht an Dritte weitergegeben. Sie können der Verwendung Ihrer Daten jederzeit widersprechen. Das Datenhandling bei Sack Fachmedien erklären wir Ihnen in unserer Datenschutzerklärung.