TAILIEUCHUNG - JavaScript Bible, Gold Edition part 145

JavaScript Bible, Gold Edition part 145. 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. | 1288 Part V Putting JavaScript to Work Listing 49-1 continued content TD TD else enter date number content TD ALIGN center i - firstDay 1 TD start new row after each week if i 7 0 i howMany content TR TR content TABLE CENTER blast entire table s HTML to the document content end -- SCRIPT BODY HTML Figure 49-1 The static table calendar generated by Listing 49-1 Chapter 49 Application Tables and Calendars 1289 In this page a little bit of the HTML the H1 heading and HR divider is unscripted. The rest of the page consists entirely of the table definition all of which is constructed in JavaScript. Though you may want to interlace straight HTML and scripted HTML within the table definition bugs exist in NN2 and NN3 that make this tactic hazardous. The safest method is to define the entire table from the TABLE to TABLE tags in JavaScript and post it to the page in one or more document. write methods. Most of the work for assembling the calendar s data points occurs inside of the for loop. Because not every month starts on a Sunday the script determines the day of the week on which the current month starts. For all fields prior to that day the for loop writes empty TD TD tags as placeholders. After the numbered days of the month begin the for loop writes the date number inside the TD . TD tags. Whatever the script puts inside the tag pair is written to the page as flat HTML. Under script control like that in the example however the script can designate what goes into each data point rather than writing fixed HTML for each month s calendar. The important point to note in this example is that although the content of the page may change automatically over time without having to redo any HTML for the next month after the page is written its contents cannot be changed. If you want to add controls or links that are to display another month or year you have to rewrite the entire page. This can be accomplished by passing the desired month and year as a search .

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.