Wiley
Wiley.com
Print this page Share

Beginning JavaScript, 4th Edition

ISBN: 978-0-470-52593-7
792 pages
October 2009
Beginning JavaScript, 4th Edition (0470525932) cover image

Description

The perennial bestseller returns with new details for using the latest tools and techniques available with JavaScript

JavaScript is the definitive language for making the Web a dynamic, rich, interactive medium. This guide to JavaScript builds on the success of previous editions and introduces you to many new advances in JavaScript development. The reorganization of the chapters helps streamline your learning process while new examples provide you with updated JavaScript programming techniques.

You'll get all-new coverage of Ajax for remote scripting, JavaScript frameworks, JavaScript and XML, and the latest features in modern Web browsers. Plus, all the featured code has been updated to ensure compliance with the most recent popular Web browsers.

  • Introduces you to the latest capabilities of JavaScript, the definitive language for developing dynamic, rich, interactive Web sites
  • Features new coverage of data types and variables, JavaScript and XML, Ajax for remote scripting, and popular JavaScript frameworks
  • Offers updated code that ensures compliance with the most popular Web browsers
  • Includes improved examples on the most up-to-date JavaScript programming techniques

Continuing in the superlative tradition of the first three editions, Beginning JavaScript, Fourth Edition, gets you up to speed on all the new advances in JavaScript development.

See More

Table of Contents

Introduction xxv

Chapter 1: Introduction to JavaScript and the Web 1

Introduction to JavaScript 1

Where Do My Scripts Go? 7

Your First Simple JavaScript Programs 8

A Brief Look at Browsers and Compatibility Problems 15

Summary 16

Chapter 2: Data Types and Variables 17

Types of Data in JavaScript 17

Variables — Storing Data in Memory 20

Using Data — Calculations and Basic String Manipulation 26

Data Type Conversion 37

Arrays 40

Summary 49

Exercise Questions 50

Chapter 3: Decisions, Loops, and Functions 51

Decision Making — The if and switch Statements 51

Looping — The for and while Statements 71

Functions 79

Summary 84

Exercise Questions 86

Chapter 4: Common Mistakes, Debugging, and Error Handling 87

D’oh! I Can’t Believe I Just Did That: Some Common Mistakes 87

Error Handling 93

Debugging 103

Summary 131

Exercise Questions 131

Chapter 5: JavaScript — An Object-Based Language 133

Object-Based Programming 133

JavaScript’s Native Object Types 139

Creating New Types of Objects (Reference Types) 177

Summary 187

Exercise Questions 188

Chapter 6: Programming the Browser 189

Introduction to the Browser’s Objects 190

Responding to the User’s Actions with Events 199

Summary 215

Exercise Questions 217

Chapter 7: HTML Forms: Interacting with the User 219

HTML Forms 219

Other Form Object Properties and Methods 222

Summary 260

Exercise Questions 262

Chapter 8: Windows and Frames 263

Frames and the window Object 264

Opening New Windows 284

Security 298

Summary 298

Exercise Questions 299

Chapter 9: String Manipulation 301

Additional String Methods 302

Regular Expressions 306

The String Object — split(), replace(), search(), and match() Methods 327

Using the RegExp Object’s Constructor 335

Summary 345

Exercise Questions 345

Chapter 10: Date, Time, and Timers 347

World Time 348

Timers in a Web Page 358

Summary 364

Exercise Questions 365

Chapter 11: Storing Information: Cookies 367

Baking Your First Cookie 367

Creating a Cookie 377

Getting a Cookie’s Value 381

Cookie Limitations 386

Cookie Security and IE6+ 388

Summary 389

Exercise Questions 389

Chapter 12: Dynamic HTML and the W3C Document Object Model 391

The Web Standards 392

The Document Object Model 397

Manipulating the DOM 422

Writing Cross-Browser DHTML 447

JavaScript and XML 453

Summary 467

Exercise Questions 468

Chapter 13: Using ActiveX and Plug-Ins with JavaScript 469

Checking for and Embedding Plug-ins (Non-IE Browsers) 470

Checking for and Embedding ActiveX Controls on Internet Explorer 474

Using Plug-ins and ActiveX Controls 480

Summary 488

Exercise Question 489

Chapter 14: Ajax 491

What Is Ajax? 491

Using the XMLHttpRequest Object 494

Creating a Simple Ajax Module 500

Validating Form Fields with Ajax 505

Things to Watch Out For 515

Summary 525

Exercise Questions 525

Chapter 15: JavaScript Frameworks 527

Picking a Framework to Work With 527

Getting Started 528

Digging Deeper Into jQuery 537

Diving into Prototype 558

Delving into MooTools 575

Summary 590

Exercise Questions 590

Appendix A: Answers to Exercises 591

Appendix B: JavaScript Core Reference 665

Appendix C: W3C DOM Reference 697

Appendix D: Latin-1 Character Set 725

Index 733

See More

Author Information

Paul Wilton owns his own company, providing online booking systems to vacation property owners, which is largely developed using JavaScript.

Jeremy McPeak is a self-taught programmer who began his career by tinkering with web sites in 1998. He is the coauthor of Professional Ajax, 2nd Edition and several online articles covering topics such as XSLT, ASP.NET Web Forms, and C#. He is currently employed at an energy-based company building in-house conventional and web applications.

See More

Downloads

Download TitleSizeDownload
All code downloads for the book 394.19 KB Click to Download
Ch01 code downloads 1.00 KB Click to Download
Ch02 code downloads 4.44 KB Click to Download
Ch03 code downloads 3.84 KB Click to Download
Ch04 code downloads 3.86 KB Click to Download
Ch05 code downloads 6.51 KB Click to Download
Ch06 code downloads 15.69 KB Click to Download
Ch07 code downloads 10.48 KB Click to Download
Ch08 code downloads 106.13 KB Click to Download
Ch09 code downloads 5.88 KB Click to Download
Ch10 code downloads 5.01 KB Click to Download
Ch11 code downloads 34.86 KB Click to Download
Ch12 code downloads 9.69 KB Click to Download
Ch13 code downloads 97.73 KB Click to Download
Ch14 code downloads 6.61 KB Click to Download
Ch15 code downloads 83.43 KB Click to Download
See More

Errata

Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.

ChapterPageDetailsDatePrint Run
7-8 Error in Text
The heading ?Linking to an External JavaScript File? and ?Advantages of using an External File? should come after ?Try it out: Painting the Page Red.?
10/11/2010
14-end Error in Code
All instances of <br> should be <br /> to be fully XHTML compliant.
10/14/2010
24 Error in Code
Use of script language JavaScript is deprecated, language is no longer a valid value.

Use: script type javascript instead.
10/11/2010
26 Error in Text
First sentence: ?Now that you?ve seen how to cope with errors,? should be stricken. Error handling is covered in depth in Chapter 4.
10/11/2010
34 & 35 Error in Text
References to Chapter 4 should be Chapter 5 (i.e.) "However in Chapter 4 you'll be looking at the Math object...."
10/11/2010
See More
Instructors Resources
Wiley Instructor Companion Site
See More
See Less

Buy Both and Save 25%!

+

Beginning JavaScript, 4th Edition (US $39.99)

-and- Teach Yourself VISUALLY Adobe Muse (US $29.99)

Total List Price: US $69.98
Discounted Price: US $52.48 (Save: US $17.50)

Buy Both
Cannot be combined with any other offers. Learn more.

Related Titles

Back to Top