TAILIEUCHUNG - Practical prototype and scipt.aculo.us part 11

Practical prototype and part 11: The information in this book is distributed on an "as is" basis, without warranty Although every pre-caution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. | 48 CHAPTER 3 COLLECTIONS OR NEVER WRITE A FOR LOOP AGAIN Notice that we re incrementing two at a time skipping all the odd values of i. Now we can extend Enumerable onto our class Enumerable Remember how works we re taking each property on Enumerable and copying it onto . And we re done. No really. Try it out function item item - zero - two - four function item return - ZERO TWO FOUR By defining one method _each we re now able to use any Enumerable method on instances of EvenArray. So to review mixing Enumerable into your own classes is a two-step process. First define the _each method. Next copy the Enumerable methods onto your class with . When using Prototype you ll find there is rarely a step three. Summary Playing with Enumerable methods is a good way to dip your toe into the Prototype pool. You ll use them in many different contexts throughout your code. And because they re abstract they re mercifully free of the annoying cross-browser issues that cast their shadow over nearly every other area of browser-based JavaScript development. Before you forge ahead make sure you re very comfortable with everything we ve covered in this chapter. CHAPTER 4 Ajax Advanced Client Server Communication By now you re almost certainly familiar with Ajax as a buzzword. Technically it s an acronym Asynchronous JavaScript and XML and refers specifically to JavaScript s XmlHttpRequest object which lets a browser initiate an HTTP request outside the confines of the traditional page request. Yawn. The technology isn t the exciting part. Ajax is huge because it pushes the boundaries of what you can do with a web UI it lets you reload part of a page without reloading the entire page. For a page-based medium like the Web this is a seismic leap forward. Ajax Rocks XmlHttpRequest XHR for short is a JavaScript interface for making arbitrary HTTP requests. It lets

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.