|
JavaScript @ Web Programming
Programming Shed : Programmer Store & Resources |
|
|
|
JavaScript Index - JavaScript Book : JavaScript for the World Wide Web: Visual QuickStart Guide
by Tom Negrino, Dori Smith Paperback: 292 pages Publisher: Peachpit Press ISBN: 0201354632; 3rd edition (June 23, 1999) JavaScript is great, but at best it is a complementary language for Web development. JavaScript for the World Wide Web offers a productive, how-to style that lets you solve a problem or pick up a trick and then move on with the rest of your work. Consistent with other members of Peachpit's Visual QuickStart Guide series, this title makes wise use of side-by-side explanations and screen shots, as well as code snippets and their analysis. This approach gives readers the feeling that the authors are sitting by their side and showing them how to code scripts. Most subjects are handled with numbered steps, such as "Validating Zip Codes," and useful tips punctuate the text. The book introduces the whole concept of JavaScript in a fast-moving but readable chapter and then moves into solving real-world challenges. The authors do a good job of covering JavaScript's capabilities, from eye-catching graphics tricks to data-entry form processing and cookie management. Particularly enjoyable is the way the book spells out many of the differences between Netscape and Microsoft dynamic HTML approaches. The JavaScript object model is laid out in an appendix, along with object compatibility between various browser flavors. To complement the book, the publisher offers a Web site that makes all of the example code easily downloadable for your use. This is a great little guide for both busy coders and JavaScript novices. From Book News, Inc.: Discusses integration of the JavaScript programming language to add interactivity to web pages with scripts for such tasks as navigation, form validation, cookie management, frame creation, and event handling. The fourth edition expands explanations of HTML in the sidebars.Book News, Inc.®, Portland, OR Book Description: JavaScript for the World Wide Web: Visual QuickStart Guide, Third Edition is the book for people who already know how to build Web pages with HTML, and are ready to take the next step in making their sites more interesting and exciting. With an easy, step-by-step approach and loads of useful illustrations, readers learn to use JavaScript to liven up their pages with dynamic images and smart forms. They'll learn to control browsers; detect which browser or plug-ins the user has and automatically take action; use JavaScript to create and manipulate windows, and much more. Book Info: Teach yourself JavaScript the quick and easy way. Quick reference guide uses pictures to guide you through the language and show you what to do. From the Publisher: This revamped edition provides an easy bridge for HTML users who are ready to tackle JavaScript. The book is aimed at the large group of less technical Web authors who know HTML but know nothing about programming. Web designers will learn how to use JavaScript the quick and easy way with pictures rather than lengthy explanations. From the Back Cover: Does the following sound familiar? You know how to build a good-looking Web page, but you'd like to add some excitement and interactivity to your site. Then the next step is JavaScript, a programming language designed to make HTML more powerful and dynamic. You don't need to be a seasoned programmer to master JavaScript--just a copy of JavaScript for the World Wide Web: Visual QuickStart Guide. This third edition of the best-selling guide includes expanded coverage of such essential topics as how to liven up your pages with dynamic images, add smart forms, and detect which browsers and plug-ins your visitors are using so you can customize the content they see. What hasn't changed is the book's clear, step-by-step approach and generous sample code and screenshots. With JavaScript: VQS, you get both an excellent introduction to the language and a handy reference tool. About the Author: Tom Negrino is a best-selling book author and contributing editor to Macworld magazine. He is the co-author of two previous editions of this book. Dori Smith writes the JavaScript columns for Macworld and DevX, and is a contributing editor for MacTech. She is the co-author of the previous editions of this book, and author of Java for the World Wide Web: Visual QuickStart Guide. Excerpted from Javascript for the World Wide Web (Visual Quickstart Guide) by Tom Negrino, Dori Smith. Copyright © 1999. Reprinted by permission. All rights reserved. One of the best uses of JavaScript is to add excitement to Web pages by animating graphics, and that's what this chapter is all about. Making images on Web pages change when the user moves the mouse over the image, thereby making the page react to the user, is one of the most common-and effective-tricks you can learn in JavaScript. This rollover, as it is called, is easy to implement, yet has many applications, as you'll see. You can also use JavaScript to create images that change automatically, and even make animated advertising banners that take the place of animated GIF files. Creating More Effective Rollovers. To make the illusion of animation work, you need to make sure that the replacement image appears immediately, with no delay while it is fetched from the server. To do that, you use JavaScript to preload all the images into the browser's cache (so that they are already on the user's hard disk when they are needed) and place the images into script variables. Then when the user moves the mouse over an image, the script swaps out one variable containing an image for a second variable containing the replacement image. Script 3.2 shows how it is done. The visible result is the same as in Figures 3.1 and 3.2, but the apparent animation is smoother. To create a better rollover: 1. if (document.images) { arrowRed = new Image arrowBlue = new Image arrowRed.src = 'images/redArrow.gif arrowBlue.src = 'images/blueArrow.gif } This code checks to see if the browser understands image objects (see sidebar). If the browser does, the code assigns arrowRed and arrowBlue to two separate image objects. Then, using the .src property, it fills the two objects with the GIFs of the red and blue arrows. 2. else { arrowRed = arrowBlue = document.arrow = }This is the code that tells old browsers (ones that failed the test in step 1) what to do. In order to keep from getting error messages in old browsers, we have tocreate some dummy variables-that is, variables that won't do anything but be created and set to empty. Think of them as placeholders. Create two variables named arrowRed and arrowBlue, andset them to empty. Then create and set document.arrow to empty, too. 3. The rest of the rollover gets handled in the link tag. When the user puts the mouse over the blue arrow graphic (onMouseover), the script swaps the blue arrow for the graphic with the red arrow (document.arrow.src=arrowRed.src). When the mouse cursor leaves the area of the graphic, the script reverts the graphic back to the blue arrow. Tips When you prepare your graphics for rollovers, make sure that all your GIF images are not transparent. Transparent images will show the image they are replacing underneath. Both the original and the replacement images need to have identical dimensions. Otherwise, the browser will resize the images for you and probably won't like the distorted result. Customer Reviews A great, hit-the-ground-running start for JavaScript, April 28, 2000 Reviewer: Steven Jarvis from Fayetteville, Arkansas This book is an apple, not an orange, so don't call it an orange. It's not a comprehensive guide to the esoteric ins and outs of JavaScript. That's what O'Reilly's JavaScript: the Definitive Guide is for. This book --- like all the books in the excellent Visual QuickStart Guide series --- is aimed at getting you into the topic and doing stuff with it quickly. The other books like the O'Reilly book (which would leave a beginner pulling her hair out) are for later. The examples in this book show you the most common uses of JS and provide sample scripts (which are available for download on the companion web site). The newer, 3d. ed. of the book adds a significant amount of additional information, and is worth the price of admission (I also owned the 2d. ed.). It gets you doing cool stuff with Javascript quickly. That simplicity is its strength and also one of my complaints about it. The examples are not often very flexible. They do one thing well (which is described quickly and in a manner in which you can easily understand), but its not always easy to modify the script to similar uses. And, because it's how it is, it doesn't teach you enough to understand the theory of the JS you're using, so you rarely understand how to modify those scripts. BUT, as I said above, that's beyond the scope of this book. One example: in the doing things with windows chapter, there are scripts for opening and closing a second window from within the main window. Great scripts and they work well. But, if you want to open the new window from the main window, then close the new window from the new window (not the main window), too bad, because it doesn't show you how to do that. But, on that point, I'm starting to lean in the direction of calling this book an orange. For absolute beginners: it's a must, and is probably the best introduction to JavaScript. For Intermediate JavaScripters, its hit or miss, so check it out thoroughly (though it's still a great quick reference for when you forget something). For advanced JavaScript and JS applications, check out one of the O'reilly reference works. There has to be a better way..., November 24, 2000 Reviewer: Roberto from Philly I am a huge fan of the Visual Quickstart series. They do a wonderful job teaching the basics, whether it be PhotoShop or HTML. Generally, they also provide more than enough information to progress to more in-depth training on a particular subject matter. I can not, however, recommend Javascript for the World Wide Web. I found this book confusing at best, lacking in substance, and poorly ordered with no logical progession in the lessons. This book is great provided all you want is some code to copy onto your page...the codes do work, but it falls short when it comes to providing a basic understanding of the language, it's syntax, and underlying principles. I had much more luck with web-based tutorials. I can not tell you where to look for a good beginning Javascript manual, but I can say that this book isn't it. ONLY COPY AND PASTE, May 28, 2002 Reviewer: A reader from Miami, FL I think this book is for the people who dont have a clue about any programming language and just want to know what the so called javascript is. I am an experienced programmer and I bought this book because I wanted to learn Javascript, instead I just got a book that says "You do this by putting this on the Web" Why you have to do that ? Figure it out by yourself. Is a "Quick" Start, so quick that at the end you dont learn anything. I now have it as a Quick Reference, if I want to do something just go to the book and copy the code from there, and no idea why. Best Javascript Book, May 26, 2002 Reviewer: Derek from United States Great, the way the authors explain is amazing. A great feature is how the authors name functions and variables to show what their script is actually doing. It's fairly short, to the point, and an amazing reference, too. |
|
|
© 2005-2006, Programming Shed
|