×

Uh-oh, it looks like your Internet Explorer is out of date.

For a better shopping experience, please upgrade now.

Javascript Bible, Third Edition with CD Rom
     

Javascript Bible, Third Edition with CD Rom

3.2 9
by Danny Goodman
 

JavaScript Bible 3rd Edition Survey of third-party authoring tools included! If JavaScript can do it, you can do it too … Create Web pages brimming with interactive content. Integrate Java applets without taxing your server. Deploy Dynamic HTML applications. With the expert advice of today's premier JavaScript authority and teacher, you'll

Overview

JavaScript Bible 3rd Edition Survey of third-party authoring tools included! If JavaScript can do it, you can do it too … Create Web pages brimming with interactive content. Integrate Java applets without taxing your server. Deploy Dynamic HTML applications. With the expert advice of today's premier JavaScript authority and teacher, you'll quickly find out how to leverage the full power of JavaScript. With characteristic clarity and precision, Danny Goodman offers beginning to advanced tutorials covering all aspects of JavaScript — plus an extensive JavaScript object and language reference. Inside, you'll find complete coverage of JavaScript

  • Pick up all the basics of JavaScript quickly — from document objects to forms to multiple windows and frames
  • Find out how to create a mouse-rollover image swapping effect
  • Master JavaScript's 30-plus powerful objects and other core language facilities — including control structures, functions, and operators
  • Use JavaScript to validate user input with form elements and hypertext links
  • Integrate Java applets into your Web pages
  • Explore the differences between Netscape and Microsoft's implementations of JavaScript
  • Deploy cross-browser Dynamic HTML applications
  • Learn how to use Netscape's debugger — and how to build your own debugging tools
CD-ROM includes the complete, ready-to-run JavaScript for the examples in the book and 7 bonus chapters with working applications:
  • Tables and calendars
  • A lookup table
  • An order form
  • A table of contents
  • Calculations and graphics
  • Intelligent "updated" flags
  • A decision helper
Plus tryout products from Macromedia and MarketWare, and a full, searchable version of the book! Mac Windows http://www.idgbooks.com System Requirements: Pentium-class or compatible machine with Windows 95 or Windows NT 4.0, or Macintosh 68040 or Power PC with System 7.0 or later; JavaScript-compatible browser; CD-ROM drive.

Editorial Reviews

Booknews
The author covers the basics of document objects and forms, control structures, functions, operators, Java applets, the differences between Netscape and Microsoft's implementations of JavaScript, cross- browser dynamic HTML applications, and debugging tools. Includes beginning and advanced tutorials, and appends answers to the tutorial exercises as well as a list of JavaScript Internet resources. The CD- ROM contains the complete JavaScript for the examples in the book and seven additional chapters with working applications, including calendars, forms, graphics, intelligent flags, and a decision helper. Annotation c. by Book News, Inc., Portland, Or.

Product Details

ISBN-13:
9780764531880
Publisher:
Wiley
Publication date:
03/16/1998
Series:
Bible Series
Edition description:
Older Edition
Pages:
1056
Product dimensions:
7.37(w) x 9.24(h) x 1.97(d)

Read an Excerpt


Chapter 4: Browser and Document Objects

This chapter marks the first of nine tutorial chapters (which compose Part 11) tailored to authors who have at least basic grounding in HTML concepts. You will see several practical applications of JavaScript and begin to see how a JavaScript-enabled browser turns familiar HTML elements into objects that your scripts control.

Scripts Run the Show

If you have authored in plain HTML, you are familiar with how HTML tags influence the way content is rendered on a page when viewed in the browser. As the page loads, the browser recognizes tags (by virtue of their containing angle brackets) as formatting instructions. Instructions are read from the top of the document downward, and elements defined in the HTML document appear on screen in the same order in which they are entered in the document. As an author, you do a little work one time up front - adding the tags - and the browser does a lot more work every time a visitor loads the page into a browser.

Assume for a moment that one of the elements on the page is a text field inside a form. The user is supposed to enter some text in the text field and then click the Submit button to send that information back to the Web server. If that information must be an Internet e-mail address, how do you ensure the user included the "@" symbol in the address?

One way is to have a Common Gateway Interface (CGI) program on the server scan the submitted form data after the user has clicked the Submit button and the form information has been transferred to the server. If the user omitted or forgot the "@" symbol, the CGI program resends the page, but this time with an instruction to include the symbol in the address. Nothing is wrong with this exchange, but it means a significant delay for the user to find out that the address does not contain the crucial symbol. Moreover, the Web server has has been transferred to the server. If the user omitted or forgot the "@" symbol, the CGI program resends the page, but this time with an instruction to include the symbol in the address. Nothing is wrong with this exchange, but it means a significant delay for the user to find out that the address does not contain the crucial symbol. Moreover, the Web server has had to expend some of its resources to perform the validation and communicate back to the visitor. If the Web site is a busy vile, the server may stop, trying to perform hundreds of these validations at any given moment, probably slowing response time to the user even more.

Now imagine if the document containing that text field had some intelligence built into it that could make sure the text field entry contains the IV symbol before ever sending one bit (literally) of data to the server. That kind of intelligence would have to be embedded in the document in some fashion downloaded with the page's content so it can stand ready to jump into action when called upon. The browser must know how to run that embedded program Some user action must start the program, perhaps when the user clicks the Start button. As the program runs, if it detects a lack of the "( )" symbol, an alert message should appear to bring the problem to the, user's attention.

This kind of presubmissiondata entry validation is but one of the practical many. JavaScript adds intelligence to an HTML document.. leaving as this as an example, you might recognize that a script must know how to look into what has been typed text field; a script must also know hopw to let a submission continue or how to abort the submission. A browser capable of running JavaScript programs conveniently treats elements such as the text field as 6hpms. A JavaScript script controls the action and behavior of objects - most of which you see in the browser window.

JavaScript in Action

By adding lines of JavaScript code, to your HTML documents, you control on screen objects as your applications requires. To give you an idea of the scope of application you can create with JavaScript, I show you several applications from the CD- ROM (in the folder named Bonus Applications)- I strongly urge you open the applications and play with them in your browser- Links to the application files from the CD-ROM can be found on the page tutor.htm in the listings folder. I also provide URLs to the examples at my Web site.

Interactive user interfaces

HTML hyperlinks do a fine job, but they're not necessarily the most engaging way to present a table of contents to a large site or document. With a bit of JavaScript, it is possible to create an interact've and expandable table of contents listing that displays the hierarchy of a large body of material (see Figure 4-1).

Click on a gray widget icon to expand the items underneath. An endpoint item has an orange and black widget icon. Items in the outline can be links to other pages or descriptive information. You also maintain the same kind of font control over each entry as you would expect from HTML. While such outlines have been created with server CGIs in the past, the response time between clicks is terribly slow. By placing all of the smarts behind the outline inside the page, it downloads once and runs quickly after each click.

As demonstrated in the detailed description of this outline in the application Outline- Style Table of Contents (Chapter 50 of the bonus applications chapters on the CD- ROM), the scriptable workings can be implemented within straight HTML for Navigator 2 and 3 and in Dynamic HTML for Navigator 4 and Internet Explorer 4. Either way you do it, the quick response and action on the screen makes for a more engaging experience for Web surfers who are in a hurry to scout your site.

Small data lookup

A common application on the Web is having a CGI program present a page that visitors use to access large databases on the server. Large data collections are best left on the server, where search engines and other technologies are the best fit. But If your page acts as a "front end" to a small data collection lookup, you can consider embedding that data collection in the document (out of view) and letting JavaScript act as the intermediary between user and data.

I've done just that in a Social Security prefix lookup system shown in Figure 4-2. 1 converted a printed table of about 55 entries into a JavaScript table that occupies only a few hundred bytes. When the visitor types the three-character prefix of his or her Social Security number into the field and clicks the Search button, a script...

Meet the Author

About the Author Danny Goodman, renowned authority and expert teacher of computer scripting languages, is the author of numerous critically acclaimed books, including Danny Goodman's AppleScript Handbook, Living at Light Speed, and the bestselling Complete HyperCard Handbook. He also writes the "JavaScript Apostle" column for Netscape's View Source online developer newsletter.

Customer Reviews

Average Review:

Post to your social network

     

Most Helpful Customer Reviews

See all customer reviews

Javascript Bible, Third Edition with CD Rom 3.2 out of 5 based on 0 ratings. 9 reviews.
Guest More than 1 year ago
Although not advertised as a beginner's book, I feel that it had some obligation to clearly show how to write JavaScript as part of the book; rather, it 'offs' the 'tutorial', as though something not worthy of the weighty tome, to a CD. The rest of the book is then filled with cryptic examples, rather than a clear exposition of the elements of the language. I am an experienced programmer and have read my share of good and bad books, but this would have to go near the bottom. The publisher seemed to want to rush something - anything - out the door.
Guest More than 1 year ago
This book provided an excellent basis for not learning JavaScript, but an excellent reference to turn back to. The example give solid understanding of the concepts of JavaScript and provide the foundation to learn beyond the teachings of the book. Good book for experienced programmers. The Best JavaScript book for beginners.
Guest More than 1 year ago
I found this book rather difficult to read, use or follow. I have some programming experience in other languages and I have read many programming books. However, this book is the worst one I have read so far. It is very poorly organized, and examples are not well explained. I can figure out most of the examples easily since I have some programming experience, but there are a handful that are still puzzling to me. The text seems to be aimed at a beginner, but it definitely is not. For example, it does not begin talking about control structures (if...else, etc.) until it reaches chapter 31, and chapter 32 introduces you to operator. However, this does not keep the author from using them in the first 30 chapters. Overall, I am very disappointed with this book and would not recommend it to anyone.
Guest More than 1 year ago
THIS BOOK ROCKS!!! READ IT PAGE BY PAGE OR ONLY LOOK UP WHAT YOU NEED. EXCELLENT EXAMPLES!!! DANNY GOODMAN IS A FORCE TO BE RECKONED WITH!!!
Guest More than 1 year ago
The reason for the title is because this book is more for a reference than for starting out and making your own javascripts. If you can get through weeks of reading the same book and learning the same style this would be a great book for you. If you want to build complex javascripts in a few days to a week I don't recommend this book. This book is loaded with information which I did find useful. All in all this book is above average but not great.
Guest More than 1 year ago
This book was written just after Netscape 4 and IE 4 came out. It is rather dated now. Also, the book refers to directories on the CD that don't exist, and the CD itself has broken links in HTML examples so you 'can't get there from here'.
Guest More than 1 year ago
This Java Script Book is OK. I have never writted Java Script before, therefore, I needed to see more real world scenerios, followed by example outputs. The scripting examples are OK, but what does it look like after compilation?
Guest More than 1 year ago
The best JavaScript refrence I have found yet. Well organized and excellent supporting CD. Supports the Macintosh platform.
Guest More than 1 year ago
Danny Goodman's book is truly a Bible for Javascript programmers, old and new. For new JS'ers, it offers an excellent balance of 'user guide' and reference. And of course for the experienced user, the reference is an excellent resource. His coverage of real-world applications of javascript, not to mention his distinctions of browser implementation and compatibility issues, make the book stand out from the pack. His reference is also so well done, with clear indications of bowser compatibility for each element and a thoughtful bottom-of-the-page indicator of the element being references, which serves as a great mechanism for quickly looking up items. If you plan to use (or learn about) Javascript, you can do no better than to get this book. As a trainer and developer of a Javascript class, this is one of the two books (along with the O'Reilly book) that we offer as the references for our class.