TAILIEUCHUNG - Foundations of ASP.NET AJAX phần 2

Bạn sẽ được tìm kiếm tại AJAX từ một mức độ cao trong cuốn sách này và ngày càng đi sâu hơn vào cách Microsoft AJAX cho phép bạn nhanh chóng và dễ dàng xây dựng ứng dụng AJAX cho phép và Internet Explorer 7, nó là một đối tượng JavaScript bản địa. | 10 CHAPTER 1 INTRODUCING AJAX You will be looking at AJAX from a high level in this book and delving more deeply into how Microsoft AJAX will allow you to quickly and easily build AJAX-enabled applications. Using the XMLHttpRequest Object As mentioned the XMLHttpRequest object is the heart of AJAX. This object sends requests to the server and processes the responses from it. In versions of Internet Explorer prior to IE7 it is implemented using ActiveX whereas in other browsers such as Mozilla Firefox Safari Opera and Internet Explorer 7 it is a native JavaScript object. Unfortunately because of these differences you need to write JavaScript code that inspects the browser type and creates an instance of it using the correct technology. Thankfully this process is a little simpler than the spaghetti code you may remember having to write when using JavaScript functions that heavily used DOM which had to work across browsers var xmlHttp function createXMLHttpRequest if xmlHttp new ActiveXObject else if xmlHttp new XMLHttpRequest In this case the code is simple. If the browser doesn t support ActiveX objects the property will be null and therefore the xmlHttp variable will be set to a new instance of the native JavaScript XMLHttpRequest object otherwise a new instance of the ActiveX Object will be created. Now that you have an XMLHttpRequest object at your beck and call you can start playing with its methods and properties. Some of the more common methods you can use are discussed in the next few paragraphs. The open method initializes your request by setting up the call to your server. It takes two required arguments the Hypertext Transfer Protocol HTTP command such as GET POST or PUT and the URL of the resource you are calling and three optional arguments a boolean indicating whether you want the call to be asynchronous which defaults to true and strings for the

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.