Creating Applications with Mozilla-Chapter 5. Scripting Mozilla- P1

Tham khảo tài liệu 'creating applications with mozilla-chapter 5. scripting mozilla- p1', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 5. Scripting Mozilla- P1 In Mozilla scripting plays important roles in the XPFE. Whether developers refer to script access and security user interface logic XPCOM object invocation or script execution in element event handlers scripting is so integral to application development that Mozilla as a development platform would be inconceivable without it. The core scripting language used in Mozilla is JavaScript. Although it has had a reputation as an unsophisticated language used mostly in web pages JavaScript is more like a first-tier programming language. Modularity good exception handing regular expression enhancement and number formatting are just some features of the new JavaScript 1 which is based on the ECMA-262 standard. 2 JavaScript due sometime late in 2002 promises to be an even bigger promotion of the language. Three distinct levels of JavaScript are identified in this chapter. A user interface level manipulates content through the DOM a client layer calls on the services provided by XPCOM and finally an application layer is available in which JavaScript can create an XPCOM component. The following section describes these levels in detail. . Faces of JavaScript in Mozilla As you have already seen in some examples in this book the user interface uses JavaScript extensively to create behavior and to glue various widgets together into a coherent whole. When you add code to the event handler of one element to manipulate another -- for example when you update the value of a textbox using a XUL button -- you take advantage of this first level of scriptability. In this role JavaScript uses the Document Object Model DOM to access parts of the user interface as a hierarchical collection of objects. The section Section later in this chapter discusses this highest level of scripting. At a second level JavaScript glues the entire user interface to the XPCOM libraries beneath which create the application core. At this level XPConnect see the .

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
5    85    2    26-04-2024
Đã 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.