TAILIEUCHUNG - Học php, mysql và javascript - p 42

Tại sao sử dụng XML? Bạn có thể hỏi tại sao bạn sẽ sử dụng XML khác hơn so với lấy các tài liệu XML như là nguồn cấp dữ liệu RSS. Vâng, câu trả lời đơn giản là bạn không phải, nhưng nếu bạn muốn chuyển dữ liệu có cấu trúc lại các ứng dụng Ajax của bạn, nó có thể là một nỗi đau thực sự để gửi một đơn giản, mớ lộn xộn tổ chức của văn bản cần chế biến phức tạp trong JavaScript | As with all form data you can use either the POST or the GET method when requesting XML data your choice will make little difference to the result. Why use XML You may ask why you would use XML other than for fetching XML documents such as RSS feeds. Well the simple answer is that you don t have to but if you wish to pass structured data back to your Ajax applications it could be a real pain to send a simple unorganized jumble of text that would need complicated processing in JavaScript. Instead you can create an XML document and pass that back to the Ajax function which will automatically place it into a DOM tree as easily accessible as the HTML DOM object with which you are now familiar. Now that you ve learned how Ajax works in raw form in the next chapter we ll look at the popular YUI library which is a framework that makes Ajax and other JavaScript even easier to use. Test Your Knowledge Questions Question 18-1 Why is it necessary to write a function for creating new XMLHttpRequest objects Question 18-2 What is the purpose of the construct Question 18-3 How many properties and how many methods does an XMLHttpRequest object have Question 18-4 How can you tell when an Ajax call has completed Question 18-5 How do you know whether an Ajax call completed successfully Question 18-6 What XMLHttpRequest object s property returns an Ajax text response Question 18-7 What XMLHttpRequest object s property returns an Ajax XML response Question 18-8 How can you specify a callback function to handle Ajax responses Question 18-9 What XMLHttpRequest method is used to initiate an Ajax request Test Your Knowledge Questions 391 Question 18-10 What are the main differences between an Ajax GET and POST request See the section Chapter 18 Answers on page 450 in Appendix A for the answers to these questions. 392 Chapter 18 Using Ajax CHAPTER 19 Using YUI for Ajax and More Let s face it JavaScript isn t the easiest programming language to master particularly if you ve never .

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.