TAILIEUCHUNG - Pro PHP Patterns, Frameworks, Testing and more phần 9

và 18-2 mô tả các thuộc tính và phương pháp có sẵn để các đối tượng bỏ một yêu cầu trong tiến trình. Được tất cả các tiêu đề phản ứng như là một chuỗi. Được một tiêu đề cụ thể theo tên. Tạo một kết nối HTTP mới. Các phương pháp có thể là bất kỳ loại yêu cầu hợp lệ như GET hoặc POST. | CHAPTER 18 AJAX AND JSON 279 all modern browsers. The script in Listing 18-5 will try the modern route first and will fall back to the ActiveX method if the native XHR object is not available. Tables 18-1 and 18-2 describe the properties and methods available to the XHR object. Table 18-1. XmlHttpRequest Methods Method Description abort Cancels an in-progress request. getAllResponseHeaders Gets all the response headers as a string. getResponseHeader name Gets a specific header by name. open method url async user pass Creates a new HTTP connection. The method may be any valid request type like GET or POST. The URL should be a fully qualified address. The async method controls whether the send method will block wait for data to come back from the server or return immediately. The user and pass parameters are used if the server resource requires HTTP authentication. send content Invokes the request to the server. It uses the settings provided to open and will either return immediately or wait for content to be received from the server based on the open method s async parameter. The content parameter is used with certain types of requests like POST to send data to the server. setRequestHeader name value Sets a request header by name and value. Table 18-2. XmlHttpRequest Properties Property Description readyState Indicates the current state of the XHR object. It returns a numeric representation of the state where 0 uninitialized 1 open 2 sent 3 receiving 4 loaded. This property is most commonly used when working asynchronously. In this case you should check that readyState equals 4 when the onreadystatechange event fires. The onreadystatechange event is fired whenever there is a change to the readystate property of the object. Most commonly this is used to discover when the response from the server is complete. Check the readyState property when the onreadystatechange event fires to determine the new state. responseText The response from the server as a string. .

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.