TAILIEUCHUNG - Ajax in Action phần 3

Các văn bản của một phần tử có thể được theo kiểu về màu sắc, kích thước phông chữ, nặng nề của phông chữ và kiểu chữ để sử dụng. Nhiều tùy chọn có thể được quy định cụ thể đối với các phông chữ, để cho phép suy thoái duyên dáng trong các tình huống | Third-party libraries and frameworks 107 Then we merge the two to provide a single object containing all of the required behavior var parent new Vehicle 24 100 var extension new CarriagePuller 12 var passTrain parent extension Note that we define the parent and extension objects separately at first and then mix them together. The parent-child relationship exists between these instances not between the Vehicle and CarriagePuller classes. While it isn t exactly classic object orientation it allows us to keep all the code related to a specific function in this case pulling carriages in one place from which it can easily be reused. While doing so in a small example like this may seem unnecessary in larger projects encapsulating functionality in such a way is extremely helpful. Prototype also provides Ajax support in the form of an Ajax object that can resolve a cross-browser XMLHttpRequest object. Ajax is extended by the type which can make requests to the server using XMLHttpRequest like so var req new The constructor uses a style that we ll also see in many of the Prototype-based libraries. It takes an associative array as an optional argument allowing a wide range of options to be configured as needed. Sensible default values are provided for each option so we need only pass in those objects that we want to override. In the case of the constructor the options array allows post data request parameters HTTP methods and callback handlers to be defined. A more customized invocation of might look like this var req new method get parameters name dave likes chocolate rhubarb onLoaded function alert loaded onComplete function alert done n n The options array here has passed in four parameters. The HTTP method is set to get because Prototype will default to the HTTP post method. The parameters array will be passed down on the querystring because we

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.