Emily A. Vander Veer9780764576591, 0-7645-7659-3
Table of contents :
JavaScript for Dummies 4Th Ed……Page 1
Table Of Content……Page 14
System Requirements……Page 22
Conventions Used in This Book……Page 23
What You’re Not to Read……Page 24
Part II: Creating Dynamic Web Pages……Page 25
Icons Used in This Book……Page 26
Where to Go from Here……Page 27
Part I: Building Killer Web Pages for Fun and Profit……Page 28
1: Hitting the Highlights: JavaScript Basics……Page 30
What Is JavaScript? (Hint: It’s Not the Same Thing as Java!)……Page 31
It’s easy! (Sort of)……Page 32
Everybody’s doing it! (Okay, almost everybody!)……Page 34
JavaScript and HTML……Page 35
JavaScript and Your Web Browser……Page 37
What Can I Do with JavaScript That I Can’t Do with Web Languages?……Page 38
Customize the way your Web site looks on-the-fly……Page 39
Hardware……Page 40
Software……Page 41
Documentation……Page 42
2: Writing Your Very First Script……Page 44
Ideas?! I got a million of ’em!……Page 45
Part I: Creating an HTML file……Page 46
Part II: Creating your script……Page 50
Part III: Putting it all together by attaching a script to an HTML file……Page 51
Testing Your Script……Page 53
JavaScript Syntax……Page 56
Don’t keep your comments to yourself……Page 57
Fully functioning……Page 63
Operators are standing by……Page 71
Working with variables……Page 77
Putting It All Together: Building JavaScript Expressions and Statements……Page 79
The browser-detection script……Page 80
The date-formatting script……Page 85
The data-gathering script……Page 89
4: JavaScript-Accessible Data: Getting Acquainted with the Document Object Model……Page 94
Object Models Always Pose Nude……Page 95
Object-ivity……Page 96
For sale by owner: Object properties……Page 98
There’s a method to this madness!……Page 100
How do you handle a hungry event? With event handlers!……Page 102
Company functions……Page 103
Dynamic objects: The least you need to know about CSS and DHTML……Page 105
Example DHTML script: Adding text dynamically……Page 107
Example DHTML script: Positioning text dynamically……Page 111
Example DHTML script: Changing page appearance on-the-fly……Page 114
Netscape Navigator……Page 117
JavaScript data types……Page 119
Microsoft Internet Explorer……Page 121
Part II: Creating Dynamic Web Pages……Page 124
Whacking Your Way through the Browser Maze……Page 126
Browser make and version……Page 127
Embedded objects……Page 133
The referrer page……Page 142
User preferences……Page 143
Cookie Basics……Page 146
Cookie security issues……Page 147
Looking at cookies from a user’s perspective……Page 148
Saving and Retrieving User Information……Page 152
Setting a cookie……Page 153
Accessing a cookie……Page 154
Displaying content based on cookie contents: The repeat-visitor script……Page 155
7: Working with Browser Windows and Frames……Page 164
Opening and closing new browser windows……Page 165
Controlling the appearance of browser windows……Page 168
Working with Frames……Page 169
Creating HTML frames……Page 170
Sharing data between frames……Page 173
Part III: Making Your Site Easy For Visitors to Navigate and Use……Page 176
Creating Simple Animations……Page 178
Now you see it, now you don’t: Turning images on and off……Page 182
Slideshow Bob: Displaying a series of images……Page 186
Creating Rollovers, Hotspots, and Navigation Bars……Page 189
Creating a simple rollover……Page 190
Creating navigation bars by putting rollovers together……Page 192
Carving up a single image into multiple hotspots……Page 198
9: Creating Menus……Page 202
Pull-down menus……Page 203
Sliding menus……Page 207
Taking Advantage of Third-Party DHTML Menu Components……Page 211
Site Map Basics……Page 212
The pull-down menu revisited……Page 214
Adding frames to the pull-down menu……Page 217
Putting it all together: Adding targeted hyperlinks……Page 218
Taking Advantage of Third-Party Site-Mapping Tools……Page 220
11: Creating Pop-Up Help (Tooltips)……Page 222
Creating Plain HTML Tooltips……Page 223
Creating an HTML map and designating active areas……Page 225
Defining a style for the tooltip……Page 226
Creating custom JavaScript functions to display and hide tooltips……Page 227
Calling custom functions in response to the onMouseOver and onMouseOut events……Page 228
Putting it all together: Using DHTML code to create simple tooltips……Page 230
Taking Advantage of Third-Party Tooltips Scripts……Page 232
Part IV: Interacting with Users……Page 234
Capturing User Input by Using HTML Form Fields……Page 236
Creating an input-validation script……Page 237
Calling a validation script……Page 242
Putting It All Together: The Order Form Validation Script……Page 243
Testing for existence……Page 245
Testing for a numeric value……Page 246
Testing for patterns……Page 248
Form-level validation……Page 249
The Skinny on Events and Event Handlers……Page 260
Handling Events……Page 261
Window events……Page 264
Mouse events……Page 265
Form events……Page 266
Keyboard events……Page 268
Exceptional Basics……Page 270
Handling Exceptions……Page 271
Part V: The Part of Tens……Page 274
Ten Web Sites to Check Out……Page 276
Project Cool’s JavaScript QuickStarts……Page 277
IRT org……Page 278
Not-to-Be-Missed Newsgroups……Page 279
16: Ten (Or So) Most Common JavaScript Mistakes (And How to Avoid Them)……Page 282
Typing-in-a-Hurry Errors……Page 283
Lonely tags……Page 284
Lonely parentheses……Page 285
Putting Scripting Statements in the Wrong Places……Page 286
Nesting Quotes Incorrectly……Page 287
Treating Numbers as Strings……Page 288
Treating Strings as Numbers……Page 289
Missing the Point: Logic Errors……Page 290
Neglecting Browser Incompatibility……Page 291
17: Ten (Or So) Tips for Debugging Your Scripts……Page 294
JavaScript Reads Your Code, Not Your Mind!……Page 295
Isolating the Bug……Page 296
Displaying Variable Values……Page 297
Breaking Large Blocks of Statements into Smaller Functions……Page 300
Honing the Process of Elimination……Page 301
Tracking HTML bugs……Page 302
Taking Advantage of Others’ Experience……Page 303
Just Try and Catch Me Exception Handling!……Page 304
Taking Advantage of Debugging Tools……Page 308
Netscape’s JavaScript console……Page 309
Microsoft Internet Explorer’s built-in error display……Page 311
Part VI: Appendixes……Page 314
Appendix A: JavaScript Reserved Words……Page 316
Appendix B: JavaScript Color Values……Page 318
The Document Object Model……Page 324
Applet……Page 325
Array……Page 326
Checkbox……Page 327
crypto……Page 328
document……Page 329
event……Page 330
Form……Page 331
Hidden……Page 332
java……Page 333
JavaPackage……Page 334
Math……Page 335
navigator……Page 336
Object……Page 337
Packages……Page 338
Radio……Page 339
RegExp……Page 340
Select……Page 341
Style……Page 342
Submit……Page 343
Textarea……Page 344
window……Page 345
eval()……Page 346
parseFloat()……Page 347
taint()……Page 348
untaint()……Page 349
Appendix D: Special Characters……Page 350
Getting the Most from This CD……Page 356
Using the CD……Page 357
What You’ll Find……Page 358
If You Have Problems (Of the CD Kind)……Page 359
Index……Page 362
Reviews
There are no reviews yet.