How to do Everything with JavaScript / Edition 1

How to do Everything with JavaScript / Edition 1

ISBN-10:
0072228873
ISBN-13:
9780072228878
Pub. Date:
02/26/2003
Publisher:
McGraw Hill LLC
ISBN-10:
0072228873
ISBN-13:
9780072228878
Pub. Date:
02/26/2003
Publisher:
McGraw Hill LLC
How to do Everything with JavaScript / Edition 1

How to do Everything with JavaScript / Edition 1

Paperback

$35.0 Current price is , Original price is $35.0. You
$35.00 
  • SHIP THIS ITEM
    Qualifies for Free Shipping
  • PICK UP IN STORE
    Check Availability at Nearby Stores
  • SHIP THIS ITEM

    Temporarily Out of Stock Online

    Please check back later for updated availability.


Overview

Publisher's Note: Products purchased from Third Party sellers are not guaranteed by the publisher for quality, authenticity, or access to any online entitlements included with the product.




This friendly, solutions-oriented guide is filled with step-by-step examples that illustrate how to write basic to advanced JavaScript applications, as well as modify existing scripts to suit individual needs. Each chapter begins with the specific how-to topics that will be covered. Within the chapter, each topic is accompanied by a solid, easy-to-follow walkthrough of the process.

Product Details

ISBN-13: 9780072228878
Publisher: McGraw Hill LLC
Publication date: 02/26/2003
Series: How to Do Everything Series
Pages: 448
Product dimensions: 7.40(w) x 9.00(h) x 0.77(d)

About the Author

Scott Duffy (Toronto, Ontario) MCSD, Sun Java 2 SCJP, CIW Associate, has eleven years of professional software design and development experience including having spent five of the past six years on web-based application development. He has written several books including "How to Do Everything with JavaScript" published by Osborne McGraw-Hill in 2002.

Table of Contents

Acknowledgmentsxv
Introductionxvii
Part ILearn JavaScript Basics
Chapter 1Prepare to Program in JavaScript3
Learn the History of JavaScript4
The Origin of JavaScript5
JavaScript Makes Its Way into Internet Explorer5
JavaScript Becomes an Official Standard5
Where JavaScript Is Today6
Choose a Development Environment7
Develop JavaScript-Enabled Web Pages7
Create Server-Based Web Applications8
Use JavaScript in a DOS or Windows Environment9
JavaScript Development Tools9
Learn What JavaScript Can and Cannot Do13
Use JavaScript as a Client-Side Language14
Use JavaScript as a Server-Side Language14
Decide Which Version of JavaScript to Use15
Test JavaScript Programs Using HTML16
Create a JavaScript Template16
Understand the JavaScript Template18
Communicate with the User19
Display an Alert Message20
Write Text to the Browser Window21
Learn More about Topics Discussed in this Chapter22
Chapter 2Learn JavaScript Fundamentals25
Understand Basic Terminology26
Store Data in Variables26
Define Variables27
Define Constants28
Understand Program Flow29
Control Program Flow with Statements30
Execute Code Conditionally30
Repeat Statements Using Loops34
Comment Your Code43
Set a Default Object44
Handle Errors46
Understand the Basics of Expressions49
Use Operators to Create Complex Expressions50
Organize Your Code into Functions51
Define Functions52
Accept Parameters54
Understand Variable Scope56
Return Values58
Use the Improvements in JavaScript 2.0 to Create More Powerful Functions59
Use Named Optional Parameters60
Accept Any Number of Parameters61
Chapter 3Use Built-in JavaScript Classes63
Learn about Objects in JavaScript64
Write Unstructured Programs65
Organize Code into Procedures65
Separate a Program into Modules66
Use the Object-Oriented Approach66
Turn Properties and Functions into a Class68
JavaScript's Built-in Classes and Data Types69
Instantiate an Object with the new Operator72
Access an Object with the Operator73
Access an Object with the [] Operator73
Create a String Object in JavaScript73
Create a String Object Using a String Literal74
Create a String Object Using the String Data Type76
Use the String Object's Built-in Functionality76
Perform Mathematical Functions78
Apply JavaScript's Date-Handling Functions79
Convert Strings into Numbers82
Use the parseInt and parseFloat Functions82
Prepare Text Before Sending to Web Server84
Use the escape and unescape Functions85
Decide When to Use Regular Expressions86
Understand the Basics of Regular Expressions87
Create Patterns with a RegExp Object89
Understand JavaScript 2.0's Powerful New Data Types91
Use the Boolean, Integer, and Number Data Types91
Use the char Data Type91
Use the Object Data Type92
Understand Special Data Types92
Chapter 4Organize Data into Arrays95
Create an Array Object97
Create an Empty Array97
Specify an Initial Array Length99
Create and Initialize an Array in One Line of Code100
Use Array Literals100
Call the Properties and Methods of the Array Object101
Set and Retrieve Values in an Array104
Use Multidimensional Arrays107
Use JavaScript 2.0's Enhanced Arrays111
The StaticArray Class112
The DynamicArray Class114
The ConstArray Class114
Chapter 5Create Your Own JavaScript Classes117
Learn about Classes in JavaScript118
Create Objects in JavaScript 1.x118
Call a Constructor Function119
Use an Object Literal122
Extend an Existing Class123
Extend an Existing Object125
Create Objects in JavaScript 2.0126
Define Your Own Classes127
Organize Classes Using Inheritance130
Choose Between Static and Instance Members135
Make Class Members Public or Private136
Part IIBuild JavaScript-Enabled Web Sites
Chapter 6Embed JavaScript in a Web Page141
Understand Basic HTML Structure142
Build an HTML Document145
Indicate the Document Type with [left angle bracket]!DOCTYPE[right angle bracket]146
Add a Title and Define Document Keywords147
Format Text with HTML Elements148
Format Text with Style Sheets150
Use [left angle bracket]script[right angle bracket] to Add JavaScript to a Web Page153
Use [left angle bracket]noscript[right angle bracket] for Browsers That Don't Support Scripting154
Load an External JavaScript File157
Call JavaScript Using Hyperlinks158
Learn More about the Topics in this Chapter159
Chapter 7Create Scripts That Work in Every Browser161
Understand Browser Differences162
What Kind of Errors Can Occur?163
Detect What Type of Browser the User Is Running164
Query the Document Model169
Stick to Web Standards170
Write Cross-Browser Code171
Chapter 8Manipulate Web Forms179
Understand HTML Forms180
Request User Input Using an HTML Form181
Process Form Input with Client-Side JavaScript182
Process Form Input on a Web Server183
Insert an HTML Form into a Web Page184
Retrieve and Set Form Control Values in JavaScript200
Access Form Values Using the forms Array200
Access Form Values Using the elements Array202
Access Form Values Using getElementById()204
Access Form Values Using getElementsByName()204
Access Form Values Using getElementsByTagName()205
Chapter 9Handle Browser Events207
Write JavaScript Event Handlers208
Handle User Interface Events209
Handle Mouse Events211
Handle Key Events212
Handle HTML Events215
Handle Events Using the Event Property218
Trigger Events in JavaScript219
Call the Method Associated with an Event219
Use the fireEvent Method220
Overcome Browser Incompatibility220
Chapter 10Communicate Between Browser Frames223
Learn the Basics of HTML Frames224
Create a Frameset in HTML225
Define and Name Frames in a Frameset233
Call JavaScript Functions from Other Frames235
Access Another Frame Using JavaScript236
Call a JavaScript Function Located in Another Frame237
Handle Synchronization Between Frames239
Chapter 11Interact with the Web Browser243
Learn the Basics of the Document Object Model245
Manipulate the Contents of a Web Page248
Dynamically Modify the Contents of a Web Page249
Change the Items in a Drop-Down List Box251
Examine the Entire Browser Window252
Retrieve Properties of the Web Browser Software254
Examine the Operating System's Display Settings256
Access the Web Browser History List257
Send the Browser to a New Location258
Chapter 12Perform Simple Animation259
Learn the Basics of Cascading Style Sheets260
Assign Style to Web Pages Using HTML Elements261
Assign Style to Web Pages Using Style Sheets264
Use Basic Style Attributes268
Position Elements on a Web Page268
Modify Styles Using JavaScript270
Understand Cross-Platform Issues272
Perform Basic Animation Using JavaScript274
Dynamically Load Images274
Make Content Move Around the Screen276
Part IIITake JavaScript to the Next Level
Chapter 13Debug JavaScript Programs281
Understand the Possible Causes of Errors282
Find the Source of an Error Message284
Interpret Error Messages285
Use a JavaScript Validator287
Add Debugging Code to Your Programs287
Use the JavaScript Console290
Use a JavaScript Debugger291
Chapter 14Make Your Program Errorproof295
Learn the Basics of Exceptions296
Catch Exceptions Using the try and catch Statements297
Understand Exception Bubbling299
Use the IE Error Object301
Use Netscape-Only catch Clauses302
Use Nonstandard finally Clauses302
Create Exceptions Using the throw Statement304
Design Programs That Are Easy to Debug from the Start306
Avoid Unstructured Programming307
Break Code into Manageable Chunks307
Reuse Code Using Classes and Objects308
Test Your JavaScript Code Thoroughly309
Create a Testing Harness309
Force Errors to Test Error-Handling Code311
Try Your Program in Many Different Environments312
Chapter 15Use JavaScript to Manage Browser Plug-Ins313
Insert Scriptable Objects into HTML Web Pages315
Include Sun Java Applets315
Connect to Java Applets Using JavaScript319
Embed Movies and Music in Web Pages321
Connect to Music and Media Objects Using JavaScript322
Use the Microsoft Calendar Control in Your Web Pages324
Appendix AHTML 4.01 Tags327
Appendix BJavaScript Quick Reference331
Index335
From the B&N Reads Blog

Customer Reviews