javascript bible 4th edition jsb gold chapters phần 2

mô hình đối tượng tài liệu có cạnh tranh cho sự chú ý của chúng tôi trong suốt lịch sử ngắn của các trình duyệt kịch bản. Netscape đã nhận được quả bóng lăn trong Navigator 2 với mô hình đối tượng đầu tiên. Vào thời điểm phiên bản 4 trình duyệt đến xung quanh, | Document Object Model Essentials Without question the biggest challenge facing clientside Web scripters is the sometimes-baffling array of document object models that have competed for our attention throughout the short history of scriptable browsers. Netscape got the ball rolling in Navigator 2 with the first object model. By the time the version 4 browsers came around the original object model had gained not only some useful cross-browser features but also a host of features that were unique to only Navigator or Internet Explorer. The object models were diverging causing no end of headaches for page authors whose scripts had to run on as many browsers as possible. A ray of hope emerged from the standards process of the World Wide Web Consortium W3C in the form of a document object model DOM recommendation. The new DOM brings forward much of the original object model plus new ways of addressing every object in a document. The goal of this chapter is to put each of the object models into perspective and help you select the model s you intend to support in your Web applications. But before we get to those specifics let s examine the role of the object model in designing scripted applications. In This Chapter Object models versus browser versions Proprietary model extensions Structure of the W3C DOM Mixing object models in a single document The Object Model Hierarchy In the tutorial chapters of Part II you were introduced to the fundamental ideas behind a document object hierarchy in scriptable browsers. In other object-oriented environments object hierarchy plays a much greater role than it does in JavaScript-able browsers. In JavaScript you don t have to 196 Part III Document Objects Reference worry about related terms such as classes inheritance and instances. Even so you cannot ignore the hierarchy concept because much of your code relies on your ability to write references to objects that depend on their positions within the hierarchy. Calling these objects .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.