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

Javascript bible_ Chapter 2


Tóm tắt Xem thử

- wonderful capabilities of the level 4 browser offerings from Netscape and Microsoft at your bidding.
- You have yet to learn the anguish of carefully devising a scripted application for the browser version you use, only to have site visitors sending you voluminous e-mail messages about how the page triggers all kinds of script errors when run on a different browser brand, generation, or operating system platform..
- Welcome to the real world of scripting Web pages in JavaScript.
- Several dynamics are at work to help make an author’s life difficult if the audience for the application uses more than a single type of browser.
- I believe if you understand the Big Picture of the browser scripting world as it stands near the beginning of 1998, you will find it easier to target JavaScript usage in your Web application development..
- Browser compatibility has been an issue for authors since the earliest days of rushing to the Web.
- Despite the fact that browser developers and other interested parties had their voices heard during formative stages of standards development, HTML authoring has rarely been the “write once, run everywhere” phenomenon that Sun Microsystems promises for the Java development environment.
- It may have been one thing to establish a set of standard tags for defining heading levels and line breaks, but it was rare for the actual rendering of content inside those tags to look identical on two different brands of browsers..
- A browser maker would build a new HTML feature into a browser and propose that feature to the relevant standards body.
- When the deployment of content depends almost entirely on an interpretive engine on the client computer receiving the data — the HTML engine in a browser, for example — authors face an immediate problem.
- Authors who developed pages in the earliest days of the Web wrestled with this question for many HTML features that we today take for granted.
- The same game continues today.
- If it were a case of Netscape and Microsoft pitching their server and browser software to customers for the creation of monolithic intranets, I could understand.
- But you are not in the majority..
- Netscape Navigator 4 and Microsoft Internet Explorer 4.
- Trying to determine where the common denominator is may be the toughest part of the authoring job..
- Allow me to describe the current status of compatibility between Navigator and Internet Explorer.
- Today, a clear distinction exists between specifications for the core JavaScript language and for the elements you script in a document (for example, buttons and fields in a form)..
- You can think of the core language as basic wiring.
- Tomorrow, the core language could be used by operating systems to let users wire together desktop applications that need to exchange information automatically..
- They’re the same objects, just different wiring..
- The separation of core language from document objects enables each concept to have its own standards effort and development pace.
- Core language standard.
- The first version of JavaScript (in Navigator 2) was Version 1.0, although that numbering was not part of the language usage.
- As you will learn later in this book, the version number is sometimes necessary in an attribute of the HTML tags that surround a script.
- The first version of Internet Explorer to include scripting was Internet Explorer 3.
- The timing of Internet Explorer 3 was roughly coincidental to Navigator 3.
- Microsoft apparently did not (and may still not) have a license to the JavaScript name.
- Even so, the HTML tag attribute that requires naming the language of the script inside the tags could be either JScript or JavaScript for Internet Explorer.
- A JavaScript script written for Navigator 2 would be understood by Internet Explorer 3..
- During this period of dominance by Navigator 3 and Internet Explorer 3, scripting newcomers were often confused because they expected the scripting languages to be the same.
- Unfortunately for the scripters, there were language features in JavaScript 1.1 that were not available in the older JavaScript version in Internet Explorer 3.
- The situation smoothes out for Internet Explorer 4.
- Its core language is up to the level of JavaScript 1.2 in Navigator 4.
- Language features new in Navigator 4 (including the script tag attribute identifying JavaScript 1.2) are understood when the scripts load into Internet Explorer 4..
- While all of this jockeying for JavaScript versions was happening, Netscape, Microsoft, and other concerned parties met to establish a core language standard..
- Due to licensing issues with the JavaScript name, the body created a new name for the language: ECMAScript..
- With only minor and esoteric differences, this first version of ECMAScript is essentially the same as JavaScript 1.1 found in Navigator 3.
- Both Navigator 4 and Internet Explorer 4 support the ECMAScript standard.
- Fortunately, the common denominator of this extended core language is broad, lessening authoring headaches on this front..
- Document Object Model.
- If Navigator 4 and Internet Explorer 4 are close in core JavaScript language compatibility, nothing could be further from the truth when it comes to the.
- document objects.
- Internet Explorer 3 based its document object model ( DOM ) on that of Netscape Navigator 2, the same browser level it used as a model for the core language.
- When Netscape added a couple of new objects to the model in Navigator 3, the addition caused further headaches for neophyte scripters who expected those objects to be in Internet Explorer 3.
- Probably the most commonly missed object in Internet Explorer 3 was the image object, which lets scripts swap the image when a user rolls the cursor atop a graphic — mouse rollovers, they’re commonly called..
- In the level 4 browsers, however, Internet Explorer’s document object model has jumped way ahead of the object model Netscape implemented in Navigator 4.
- You will see the benefits of this expanded object model in chapters that cover scripting Dynamic HTML (Chapters 41 through 43).
- At the same time, a document object model standard is being negotiated under the auspices of the World Wide Web Consortium ( W3C).
- An HTML-specific subset of the DOM standard will support object syntax implemented in Navigator 3.
- If you wish to script to a common denominator, most of the document object model in Navigator 4 is supported in Internet Explorer 4.
- Navigator 4 and Internet Explorer 4 claim compatibility with a W3C.
- Neither company’s implementation is 100 percent compatible with the W3C standard, although Internet Explorer 4 has fewer omissions than Navigator 4..
- Internet Explorer 4 does not recognize these so-called JavaScript style sheets..
- JavaScript also comes into play on the Internet Explorer side, because its object model embraces the implementation of CSS1 in the browser.
- information is part of the object model, and is therefore accessible and modifiable from JavaScript.
- This is not the case in Navigator 4..
- Perhaps the biggest improvements to the inner workings of the level 4 browsers from both Netscape and Microsoft revolve around a concept called Dynamic HTML ( DHTML).
- To that end, the W3C organization is developing another standard for the precise positioning of HTML elements on a page as an extension of the CSS standards effort.
- The CSS-Positioning recommendation adds to the CSS1 syntax for specifying an exact location on the page where an element is to appear, whether the item should be visible, and what order it should take among all the items that might overlap it..
- Internet Explorer 4 adheres to the CSS-P standard, and makes positionable items subject to script control.
- Such positionable items are scriptable in Navigator 4 as well, although some of the script syntax is different from that used in Internet Explorer 4.
- Even if you try to script to a common denominator, it probably won’t take into account the earlier versions of both the JavaScript core language and the browser document object models..
- Each new generation of browser not only brings with it new and exciting features you are probably eager to employ in your pages, it also adds to the fragmentation of the audience visiting a publicly accessible page.
- Even if you wish to adhere to the absolutely lowest common denominator of scripting, I’ve got you covered: The tutorial of Part II focuses on language and object aspects that are compatible with every version of JavaScript..
- Only a good working knowledge of JavaScript and an examination of the cool source code will reveal how well it will work for your visitors.

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