TAILIEUCHUNG - JavaScript Bible, Gold Edition part 158

JavaScript Bible, Gold Edition part 158. This book will bring programmers and non-technical professionals, including casual programmers and scripters, painlessly up to speed on all aspects of mastering JavaScript. Key topics include programming fundamentals, JavaScript language elements and how to use them effectively, and how to easily and efficiently add powerful new functionality to HTML documents and Java applets. | 1418 Part V Putting JavaScript to Work colors aren t easily distinguishable in Figure 57-1 but if you open the actual example listing in IE5 Windows on your computer you will see the coloration. Implementation Plan Clearly all the data needed for numerous sorted and ordered views arrives in one batch in the XML island. Despite the element and node referencing properties and methods of the W3C DOM trying to use the XML elements as the sole data store for scripts to sort the data each time would be impractical. For one thing none of the elements have ID attributes there s no need for it in the XML stored on the server database. And even if they did have IDs how would scripts that you desire to write for generalizability make use of them unless the IDs were generated in a well-known sequence Moreover after a sales rep s record is rendered in the table how easy would it be to dive back into that record and drill down for further information such as the name of a representative s manager A solution that can empower the page author in this case is to use the nodewalking properties and methods of the W3C DOM to assemble a JavaScript-structured database while the page loads. In other words the conversion is performed just once during page loading and the JavaScript version is preserved in an array of XML records in this case as a global variable. Any transformations on the data can be done from the JavaScript database with the help of additional powers of the language. Given that route the basic operation of the scripting of the page is schematically simple 1. Convert the XML into an array of objects at load time. 2. Predefine all necessary sorting functions based on properties of those objects. 3. Provide a function that rebuilds the HTML table each time data is sorted. With this sequence in mind now look into the code that does the job. The Code Rather than work through the long document in source code order the following descriptions follow a more functional order. You

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.