« Home « Kết quả tìm kiếm

JavaScript Bible, Gold Edition part 2


Tóm tắt Xem thử

- x JavaScript Bible, Gold Edition.
- Eventually they demanded that the browser support what is now known as “Dynamic HTML” (one fun link: http://www.javascript-games.org/.
- The primacy of JavaScript on the Web today vindicates our early belief in the value of a scripting language for HTML authors.
- Perhaps the ultimate example of Web develop- ment’s convergence with application development is the Mozilla browser, wherein all of the user-interface and even some custom widgets and modular components are implemented entirely using JavaScript, Cascading Style Sheets (CSS), custom XML-based markup languages, and images..
- Work toward a Fourth Edition of the lan- guage, supporting optional types, classes, and versioning facilities, progresses within the ECMA technical committee (see the “JS2” proposal to the ECMA technical committee documented at http://www.mozilla.org/js/language/js20/.
- The book in your hands compiles thousands of those “developer miles” with the insight of an expert guide and teacher.
- Danny didn’t know at the time how much inspi- ration I found in his HyperCard book, but it was on my desk throughout the develop- ment of JavaScript in 1995.
- His energy, compassion, and clear prose helped me keep the goal of “a language for all” in mind.
- It is enormously gratifying to write the foreword to the Gold edition of this book, which has earned so many “satisfied reader miles.”.
- I highly recommend Danny Goodman’s JavaScript Bible to anyone who wants to learn JavaScript, and especially to those HTML authors who’ve so far written only a few scripts or programs — you’re in for a lifetime of fun on the “scripting road” with a trusty guide at your side..
- Whenever possible, I like to get in at the very beginning of a new authoring or programming environment, feel the grow- ing pains, and share with readers the solutions to my struggles.
- This Gold edition of the JavaScript Bible represents knowledge and experience accumulated over five years of daily work in JavaScript and a constant monitoring of newsgroups for ques- tions, problems, and challenges facing scripters at all levels.
- While previous editions of this book focused on the then-predominant Netscape Navigator browser, the swing of the browser market share pendulum currently favors Microsoft Internet Explorer.
- At the same time, Netscape has accomplished the admirable task of reinventing its own browser in light of rapidly advancing industry standards.
- But empowering you to design and write good scripts is my pas- sion, regardless of browser.
- Therefore, the book contains details about proprietary and standard implementations to equip you to choose the development path that best fits your content’s audience.
- If you detect any bias of mine throughout this book, it is a desire, where possible, to write scripts that work on as many browsers as possible..
- Organization and Features of This Edition.
- Because of the greatly expanded range of vocabularies that scripts may use in the latest browser versions, the biggest change to the structure of the book is in the ref- erence portion.
- Here are some details about the book’s structure..
- Part I of the book begins with a chapter that shows how JavaScript compares with Java and discusses its role within the rest of the World Wide Web.
- xii JavaScript Bible, Gold Edition.
- arrived on the scene.
- Exercises fol- low at the end of each lesson to help reinforce what you just learned and challenge you to use your new knowledge (you’ll find answers to the exercises in Appendix C)..
- The goal of the tutorial is to equip you with sufficient experience to start scripting simple pages right away while making it easier for you to understand the in-depth discussions and examples in the rest of the book.
- By the end of the final lesson, you’ll know how to script multiple frame environments and even create the mouse- rollover image swapping effect that is popular in a lot of Web pages these days..
- You can find all of the Part II chapters on the CD-ROM that accompanies this book..
- Part III, the largest section of the book, provides in-depth coverage of the document object models as implemented in browsers from the earliest days to today.
- One chapter in particular, Chapter 15, contains ref- erence material that is shared by most of the remaining chapters of Part III.
- To help you refer back to Chapter 15 from other chapters, a dark tab along the outside edge of the page shows you at a glance where the chapter is located.
- Additional naviga- tion aids include guide words at the bottoms of most pages to indicate which object and object feature is covered on the page..
- Guide words at the bottoms of pages help you find a particular term quickly..
- In Part V, I get down to the business of deploying JavaScript.
- On the CD-ROM.
- Dynamic HTML in a cross- browser environment is the subject of Chapter 47, while Chapter 48 introduces you to Microsoft’s behaviors mechanism for Windows..
- The remaining nine chapters consist of full-fledged applications of JavaScript.
- Instead, their goal is to demonstrate many of the concepts described earlier in the book by way of real-world examples.
- Finally, several appendixes at the end of the book provide helpful reference informa- tion.
- In Appendix E, you also find information on using the CD-ROM that comes with this book..
- CD-ROM.
- The accompanying CD-ROM contains over 300 ready-to-run HTML documents that serve as examples of most of the document object model and JavaScript vocabu- lary words in Parts III and IV.
- You can run these examples with your JavaScript- enabled browser, but be sure to use the index.html page in the listings folder as a gateway to running the listings.
- I intentionally omitted the script listings from the tutorial part (Part II) of this book to encourage you to type the scripts.
- I believe you learn a lot, even by aping listings from the book, as you get used to the rhythms of typing scripts in docu- ments.
- You also find listings from Parts I and V on the CD-ROM..
- The CD-ROM holds another valuable resource: dozens and dozens of Example sec- tions for Parts III and IV, which are compiled in Appendix F.
- Even more Example sections invite you to try out an object model or language feature with the help of an interactive workbench, called The Evaluator — a JavaScript Bible exclusive! You see instant results and quickly learn how the feature works..
- The Quick Reference from Appendix A is in .pdf format on the CD-ROM for you to print out and assemble as a handy reference, if desired.
- Adobe Acrobat Reader is also included on the CD-ROM so that you can read this .pdf file.
- Finally, the text of the book is in a .pdf file format on the CD-ROM for easy searching..
- xiv JavaScript Bible, Gold Edition.
- Although this book doesn’t demand that you have a great deal of programming experience behind you, the more Web pages you’ve created with HTML, the easier you will find it to understand how JavaScript interacts with the familiar elements you normally place in your pages.
- If you are familiar with those tags already, the JavaScript enhancements will be simple to digest..
- The focus here is on client-side scripting, which operates independently of the server after the JavaScript-enhanced HTML page is fully loaded into the browser..
- The basic vocabulary of the current HTML standard should be part of your working knowledge.
- If you’ve never programmed before.
- To someone who learned HTML from a slim guidebook a few years ago, the size of this book must be daunting.
- JavaScript may not be the easiest language in the world to learn, but believe me, it’s a far cry from having to learn a full programming language, such as Java or C.
- The JavaScript interpreter built into every scriptable browser does a great deal of the technical work for you..
- The initial hurdle of learning to program is becoming comfortable with the way a programming language wants its words and numbers organized in these instruc- tions.
- Because com- puters generally are dumb electronic hulks, they aren’t very forgiving if you don’t.
- communicate with them in the specific language they understand.
- When speaking to another human, you can flub a sentence’s syntax and still have a good chance of the other person’s understanding you fully.
- statement — adds to your knowledge of the language..
- If you’ve done a little programming before.
- Part of this has to do with the typical tasks a script performs (carrying out a very specific task in response to user action within a Web page), but a large part also has to do with the nature of object-oriented programming..
- In a typical procedural program, the programmer is responsible for everything that appears on the screen and everything that happens under the hood.
- To determine which button a user clicks, the program examines the coordinates of the click and compares those coordinates against a list of all button coordinates on the screen.
- At the same time, the system software and browser, working together, can send a message to an object — depending on what the user does — to trigger the script.
- The script is connected to the field, and it contains the instructions that the field carries out after the user acti- vates it.
- Another set of instructions may control what happens when the user types an entry and tabs or clicks out of the field, thereby changing the content of the field..
- Some of the scripts you write may seem to be procedural in construction: They contain a simple list of instructions that are carried out in order.
- But when dealing with data from form elements, these instructions work with the object-based nature of JavaScript.
- The script then acts on the properties of those objects to get some work done..
- xvi JavaScript Bible, Gold Edition.
- But when the concept clicked — a long, pensive walk helped — so many light bulbs went on inside my head that I thought I might glow in the dark.
- If you’ve programmed in C before.
- Operator symbols, conditional structures, and repeat loops follow very much in the C tradition.
- With so much of JavaScript’s syntax familiar to you, you will be able to concentrate on document object model concepts, which may be entirely new to you.
- If you’ve programmed in Java before.
- A variable can contain an integer value in one statement and a string in the next (though I’m not saying that this is good style).
- At the same time, however, JavaScript’s designers knew that you’d have some hard-to-break habits.
- For example, although JavaScript does not require a semicolon at the end of each statement line, if you type one in your JavaScript source code, the JavaScript interpreter won’t balk..
- If you’ve written scripts (or macros) before.
- Experience with writing scripts in other authoring tools or macros in productivity programs is helpful for grasping a number of JavaScript’s concepts.
- A great deal of the scripting you will do in JavaScript matches that pattern exactly..
- The script listings and words in this book are presented in a monospace font to set them apart from the rest of the text.
- In such cases, the remainder of the script appears in the following line, flush with the left margin of the listing, just as they would appear in a text editor with word wrapping turned on..
- If these line breaks cause you problems when you type a script listing into a docu- ment yourself, I encourage you to access the corresponding listing on the CD-ROM to see how it should look when you type it..
- To make it easier to spot in the text when a particular browser and browser version is required, most browser references consist of a two-letter abbreviation and a version number.
- Moreover, IE3 for Windows can be equipped with one of two versions of the JScript .dll file.
- A reference to the earlier version is cited as IE3/J1, while the later version is cited as IE3/J2.
- You will see this notation primarily in the compatibility charts throughout the reference chapters..
- Note, Tip, and Caution icons occasionally appear in the book to flag important points..
- On the CD-ROM icons point you to useful examples and code listings found on this book’s companion CD-ROM..
- and fellow scripters and newsgroup kibitzers, who unwittingly advised me as to where scripters were having trouble with the language.
- Above all, I want to thank the many readers of the first three editions of this book (with both titles, Danny Goodman’s JavaScript Handbook and JavaScript Bible) for investing in this ongoing effort.
- Now it’s time to get down to the fun of learning JavaScript

Xem thử không khả dụng, vui lòng xem tại trang nguồn
hoặc xem Tóm tắt