TAILIEUCHUNG - JavaScript Bible, Gold Edition part 151

JavaScript Bible, Gold Edition part 151. This book will bring programmers and non-technical professionals, including casual programmers and scripters, painlessly up to speed on all aspects of mastering JavaScript. Key topics include programming fundamentals, JavaScript language elements and how to use them effectively, and how to easily and efficiently add powerful new functionality to HTML documents and Java applets. | 1348 Part V Putting JavaScript to Work the entire outline HTML to be assigned to the innerHTML property of the empty DIV element delivered with the document. initialize first time function init outlinelD if supportVerified outlineID demo how to get outline head elements var hdr outlineID .getElementsByTagName head Q get outline body elements for iterative conversion to HTML var ol outlineID .getElementsByTagName body Q wrap whole outline HTML in a span var olHTML SPAN ID renderedOL makeHTML outlineID ol SPAN throw HTML into content DIV for display content .innerHTML olHTML initExpand outlineID Validation of browser support is handled by the supportVerified function. This function is in search of the XMLDocument property of the XML element object. The property s presence indicates that the browser has what it takes to treat embedded XML as a data island. Incremental tests are needed so that earlier browsers don t choke on the reference to the property. verify that browser supports XML islands function supportVerified testID if testID testID .XMLDocument return true else var reply confirm This example requires a browser with XML data island support such as IE5 Windows. Go back to previous page if reply else return false return false Accumulating the HTML From the i nit function a call to the makeHTML function starts the most complex actions of the scripts on this page. This function walks the node hierarchy of the outline s BODY elements deciphering which ones are containers and which ones are end points. Two global variables are used to keep track of how far the node walk progresses because this function calls itself from time to time to handle nested branches of the node tree. Because a reflexive call to a function starts out with new values for local variables the globals operate as pointers to let statements

TỪ KHÓA LIÊN QUAN
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.