TAILIEUCHUNG - Ajax For Dumies phần 6

Tham khảo tài liệu 'ajax for dumies phần 6', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 148 Part II Programming in Ajax var XMLHttpRequestObject false if XMLHttpRequestObject new XMLHttpRequest else if XMLHttpRequestObject new ActiveXObject function getData dataSource divID if XMLHttpRequestObject var obj divID GET dataSource function if 4 200 null So to use a new XMLHttpRequest object for each request all you have to do is to use your mastery of inner functions to move the part of the code where the XMLHttpRequest object is created inside the getData function because the getData function is the outer function that encloses the anonymous inner function. That ll create a new XMLHttpRequest object to be used by the anonymous inner function each time getData is called and each time getData is called a new copy of getData will be created. That s what you want a new XMLHttpRequest object for each new request. Here s what that looks like in an example in the book s code multiobject. html where the XMLHttpRequest object creation part has been moved inside the outer function getData. Note that this example also deletes each XMLHttpRequest object as it finishes with it. That isn t necessary but it s a good idea to avoid cluttering up memory with extra XMLHttpRequest objects. html head title Using multiple XMLHttpRequest objects title script language javascript function getData dataSource Chapter 4 Ajax in Depth 149 var XMLHttpRequestObject false if XMLHttpRequestObject new XMLHttpRequest else if XMLHttpRequestObject new ActiveXObjectC if XMLHttpRequestObject GET datasource .

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.