ASP.NET AJAX Programmer’s Reference with ASP.NET 2.0 or ASP.NET 3.5 phần 9

Tiếp theo, nó gọi phương pháp getElementByTagName vào đối tượng tài liệu để trả về một mảng có chứa tài liệu tham khảo cho tất cả các phần tử HTML kịch bản trên trang hiện tại: Cuối cùng, readLoadedScripts lặp lại thông qua các yếu tố kịch bản HTML và cho biết thêm giá trị của thuộc tính src HTML của mỗi phần tử bộ sưu tập tĩnh | Chapter 24 Asynchronous Partial Page Rendering Next it calls the getElementByTagName method on the document object to return an array that contains references to all the script HTML elements on the current page var existingScripts SCRIPT Finally readLoadedScripts iterates through these script HTML elements and adds the value of the src HTML attribute of each element to the _referencedScripts static collection of the _ScriptLoader class existingScripts i .src Listing 24-9 The readLoadedScripts Static Method of the _ScriptLoader Class function Sys _ScriptLoader readLoadedScripts if var existingScripts SCRIPT for i - 1 i 0 i-- if existingScripts i . if existingScripts i .src existingScripts i .src getInstance As Listing 24-10 shows the getInstance static method of the _ScriptLoader class ensures that each page can have only one instance of the _ScriptLoader class. Listing 24-10 The getInstance Static Method of the _ScriptLoader Class function Sys _ScriptLoader getInstance if new return 1211 Chapter 24 Asynchronous Partial Page Rendering queueScriptBlock As you can see from Listing 24-11 the queueScriptBlock method of the _ScriptLoader class creates an object with a single name value pair and adds it to the _scriptToLoad array of the current _ScriptLoader instance. Note that the name part of this name value pair is the keyword text and the value part contains the script being queued. Listing 24-11 The queueScriptBlock Method of the _ScriptLoader Class function Sys _ScriptLoader .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã 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.