Mastering Javascript Premium Edition


JavaScript is the most widely used scripting language for the Web and continues to grow in popularity. With this Premium Edition of Mastering JavaScript and its companion CD, savvy HTML users can learn to write JavaScript programs that will make their Web sites come alive! This is the most comprehensive tutorial and reference available, with information on both Netscape and Microsoft's enhancements of JavaScript. The book starts with everything beginners need to know and then moves on to more advanced topics, ...

See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (9) from $1.99   
  • New (3) from $89.35   
  • Used (6) from $1.99   
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any coupons and promotions
Seller since 2008

Feedback rating:



New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.


Ships from: Chicago, IL

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Seller since 2015

Feedback rating:


Condition: New
Brand New Item.

Ships from: Chatham, NJ

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
Seller since 2015

Feedback rating:


Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Sort by
Sending request ...


JavaScript is the most widely used scripting language for the Web and continues to grow in popularity. With this Premium Edition of Mastering JavaScript and its companion CD, savvy HTML users can learn to write JavaScript programs that will make their Web sites come alive! This is the most comprehensive tutorial and reference available, with information on both Netscape and Microsoft's enhancements of JavaScript. The book starts with everything beginners need to know and then moves on to more advanced topics, such as scripting ActiveX components, working with plug-ins, building multimedia applications, and interfacing with CGI programs. The author is a well-known Internet programming expert and has led the development of secure networks for the Department of Defense.

Read More Show Less

Product Details

  • ISBN-13: 9780782128192
  • Publisher: Wiley
  • Publication date: 11/28/2001
  • Series: Mastering Series
  • Edition description: Premium Edition
  • Edition number: 1
  • Pages: 1104
  • Product dimensions: 7.46 (w) x 9.02 (h) x 2.60 (d)

Meet the Author

James Jaworski is an independent consultant specializing in JavaScript, Java, and information security. He has written nine books on these topics. He also writes the security column for O'Reilly's OnJava website and the Superscripter column for CNET's website.

Read More Show Less

Read an Excerpt

Chapter 2: Introducing JavaScript and JScript

This chapter introduces you to the JavaScript language. I'll show you how JavaScript works with both the Netscape and Microsoft browsers and web servers and how to embed JavaScript statements in HTML documents. I'll then cover JavaScript's use of types and variables and show you how to use arrays. By the time you have finished this chapter you'll be able to write simple scripts and include them in your web pages.

JavaScript with Browsers and Servers

JavaScript is a script-based programming language that supports the development of both client and server components of web-based applications. On the client side it can be used to write programs that are executed by a web browser within the context of a web page. On the server side it can be used to write web server programs that can process information submitted by a web browser and then update the browser's display accordingly. Figure 2.1 provides an overview of how JavaScript supports both client and server web programming.
NOTE Microsoft's version of JavaScript is named JScript. I use "JavaScript" to refer to both JavaScript and JScript unless I'm referring to one but not the other. In these cases I'll refer to "Netscape's JavaScript" and "Microsoft's JScript."

On the left side of the figure a web browser displays a web page. As I mentioned in Chapter 1 "Learning the Fundamentals" this is a result of the browser acting on the instructions contained in an HTML file. The browser reads the HTML file and displays elements of the file as they are encountered. In this case the HTML file (which the browser has retrieved from a web server seen on the right) contains embedded JavaScript code. The process of reading the HTML file and identifying the elements contained in the file is referred to as parsing. When a script is encountered during parsing the browser executes the script before continuing with further parsing.

The script can perform actions such as generating HTML code that affects the display of the browser window. It can perform actions that affect the operation of plug-ins Java applets or ActiveX components. The script can also define JavaScript language elements that are used by other scripts. Figure 2.2 summarizes the parsing of HTML files that contain JavaScript scripts.

Some scripts may define functions for handling events that are generated by user actions. For example you might write a script to define a function for handling the event "submitting a form" or "clicking a link."The event handlers can then perform actions such as validating the form's data generating a custom URL for the link or loading a new web page.

JavaScript's event-handling capabilities provide greater control over the user interface than HTML alone. For example when a user submits an HTML form a browser that isn't implementing JavaScript handles the "submit form" event by sending the form data to a CGI program for further processing. The CGI program processes the form data and returns the results to the web browser which displays the results to the user. By comparison when a user submits an HTML form using a browser that does implement JavaScript a JavaScript eventhandling function may be called to process the form data. This processing may vary from validating the data (that is checking to see that the data entered by the user is appropriate for the fields contained in the form) to performing all of the required form processing eliminating the need for a CGI program. In other words JavaScript's event-handling capabilities allow the browser to perform some if not all of the form processing. Figure 2.3 compares JavaScript's event-handling capabilities to those provided by HTML. Besides providing greater control over the user interface these event-handling capabilities help to reduce network traffic the need for CGI programs and the load on the web server.

TIP I'll cover JavaScript's event-handling capabilities more fully in Chapter 4 " Handling Events."

While JavaScript's browser programming capabilities can eliminate the need for some server-side programs others are still required to support more advanced web applications such as those that access database information support electronic commerce or perform specialized processing. Server-side JavaScript scripts are used to replace traditional CGI programs. Instead of a web server calling a CGI program to process form data perform searches or implement customized web applications a JavaScript-enabled web server can invoke a precompiled JavaScript script to perform this processing. The web server automatically creates JavaScript objects that tell the script how it was invoked and the type of browser requesting its services;it also automatically communicates any data supplied by the browser. The script processes the data provided by the browser and returns information to the browser via the server. The browser then uses this information to update the user's display. Figure 2.4 illustrates how server-side scripts are used.

There are several advantages to using server-side JavaScript scripts on Netscape and Microsoft web servers:

  • Because these web servers have been specially designed for executing JavaScript scripts they are able to minimize the processing overhead that is usually associated with invoking the script passing data and returning the results of script processing.
  • You can use JavaScript to replace CGI scripts written in other languages. This eliminates the problems that are usually associated with managing multiple CGI programs which may have been written in an OS shell language Perl tcl C and other languages. It also provides tighter control over the security of these server-side applications.
  • The database extensions integrated within these servers provide a powerful capability for accessing information contained in compatible external databases. These database extensions may be used by server-side scripts.
The database connectivity supported by these servers enables even beginning program- mers to create server-side JavaScript programs to update databases with information pro- vided by browsers (usually through forms) and to provide web users with web pages that are dynamically generated from database queries. You can imagine how exciting this is for researchers gathering and reporting information over the Web and for entrepreneurs who have catalogs full of products and services to sell over the Web. Figure 2.5 illustrates the use of JavaScript to provide database connectivity to web applications.
NOTE In this section I've provided an overview of the different ways in which JavaScript can be used for browser and server-side web applications. JavaScript's syntax is the same for both client (browser) and server programming; however the examples I will be using in this chapter mainly reflect how JavaScript relates to browser programming. For examples of JavaScript server programming see the five chapters that make up Part VI"Programming Servers."

Embedding JavaScript in HTML

JavaScript statements can be included in HTML documents by enclosing the statements between an opening <script> tag and a closing </script> tag. Within the opening tag the LANGUAGE attribute is set to "JavaScript" to identify the script as being JavaScript as opposed to some other scripting language such as Visual Basic Script (VBScript) . The script tag is typically used as follows...
Read More Show Less

Table of Contents


Part I: Getting Started with JavaScript and Jscript.

Chapter 1: Learning the Fundamentals.

Chapter 2: Introducing JavaScript and Jscript.

Chapter 3: Using Operators, Statements, and Functions.

Chapter 4: Handling Events.

Chapter 5: Working with Objects.

Chapter 6: Debugging Your Scripts.

Part II: Programming the Document Object Model.

Chapter 7: Creating Frames and Windows.

Chapter 8: Processing Forms.

Chapter 9: Using Hidden Fields and Cookies.

Chapter 10: Working with Links.

Chapter 11: Using Images.

Chapter 12: Working with Styles and DHTML.

Chapter 13: Using the W3C DOM Level 1.

Part III: Developing Components and Applications.

Chapter 14: Creating Basic JavaScript Components.

Chapter 15: Developing Animations and Slide Shows.

Chapter 16: Building Tabbed Panels, Trees, and Menu Bars.

Chapter 17: Developing Web Page Accessories.

Chapter 18: Developing Search Tools.

Chapter 19: Developing E-commerce Applications.

Chapter 20: Game Programming.

Part IV: Working with XML-Capable Browsers.

Chapter 21: Learning XML.

Chapter 22: Displaying XML with Internet Explorer and Navigator.

Chapter 23: Scripting XML.

Chapter 24: Working with XSLT.

Chapter 25: Creating XML-Based Web Applications.

Chapter 26: Working with Browser-Specific XML Capabilities.

Part V: Communicating with Java, ActiveX, and Plug-Ins.

Chapter 27: Communicating with Java Applets.

Chapter 28: Scripting ActiveX Components.

Chapter 29: Scripting Plug-Ins.

Part VI: Shell Programming.

Chapter 30: Programming Rhino.

Chapter 31: Working with Windows Scripting Host.


Appendix A: Doing Math.

Appendix B: Using Regular Expressions.

Appendix C: ECMAScript (Rev 3) Object Reference.

Appendix D: DOM 0 Object Reference.

Appendix E: DOM 1 Object Reference.

Appendix F: Cascading Style Sheets.


Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)