tailieunhanh - JavaScript Bible, Gold Edition part 78
JavaScript Bible, Gold Edition part 78. 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. | 618 Part III Document Objects Reference Listing 27-1 Replacing Table Cell Content HTML HEAD TITLE Modifying Table Cell Content TITLE STYLE TYPE text css .absoluteWrap position absolute .relativeWrap position relative .total color red STYLE SCRIPT LANGUAGE JavaScript var Ver4 parselnt 4 var Ver4Up parselnt 4 var Nav4 Netscape Ver4 var modifiable calculate and display a row s total function showTotal qtyList var qty .value var prodID var total US qty parseFloat prodID Price .value var newCellHTML SPAN CLASS total total SPAN if Nav4 prodID TotalWrapper . prodID Total . newCellHTML prodID TotalWrapper . prodID Total . else if modifiable if prodID Total .innerHTML newCellHTML else prodID Total .innerHTML newCellHTML initialize global flag for browsers capable of modifiable content function init modifiable Ver4Up display content for all products . in case of Back navigation function showAllTotals form for var i 0 i i if i .type select-one showTotal i SCRIPT HEAD Chapter 27 Table and List Objects 619 BODY onLoad init showAllTotals H1 Modifying Table Cell Content H1 HR FORM NAME orderForm TABLE BORDER 1 COLGROUP WIDTH 150 COLGROUP WIDTH 100 COLGROUP WIDTH 50 COLGROUP WIDTH 100 TR TH Product Description TH TH Price Each TH TH Quantity TH TH Total TH TR TR TD Wonder Widget 9000 TD TD US TD TD SELECT NAME ww9000 onChange showTotal this OPTION VALUE 0 0 OPTION VALUE 1 1 OPTION VALUE 2 2 OPTION VALUE 3 3 SELECT INPUT TYPE hidden NAME ww9000Price VALUE TD TD SCRIPT LANGUAGE JavaScript if Nav4 var placeHolder nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp placeHolder nbsp nbsp nbsp nbsp nbsp nbsp .
đang nạp các trang xem trước