tailieunhanh - Creating Applications with Mozilla-Chapter 2. Getting Started- P2
Tham khảo tài liệu 'creating applications with mozilla-chapter 2. getting started- p2', 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 2. Getting Started- P2 . Making Mozilla Work for You The second Hello World sample shown in Example 2-4 adds some important application features and begins to take advantage of the resources that Mozilla provides for you. This section goes over the ways you can import stylesheets and Mozilla scripts to make your XUL more sophisticated and modular. It also prepares you to make an actual application. You can see this example in action by saving the code in Example 2-4 to a file and then launching Mozilla and selecting File Open File from the browser. This displays the example as content in the Mozilla browser as shown in Figure 2-2. Example 2-4. Sample XUL window xml version xml-stylesheet href chrome global skin type text css DOCTYPE window window title Hello xFly xmlns html http 1999 xhtml xmlns http keymaster gatekeeper style background-color white width 300 height 215 onload centerWindowOnScreen script type application x-javascript src chrome global content vbox align left label style font-weight bold value Hello Welcome to the xFly image src http button label hello xFly oncommand alert Hello World vbox window The difference between Example 2-4 and the first example is the addition of new elements including the script element that brings in Mozilla JavaScript functions for use additional box layout properties inline style rules and processing instructions to import stylesheets and the DOCTYPE declaration which we describe later in this chapter in the section Section . These extras make your XUL file work more like an application by giving you access to services and features that already exist in Mozilla. They can also help you organize your own work into reusable parts such as application stylesheets widgets and script libraries as described later in this chapter in the section Section . Figure 2-2. The second Hello xFly example loaded in .
đang nạp các trang xem trước