Advertisement
Guest User

Untitled

a guest
Sep 1st, 2011
2,709
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1.  
  2. <html>
  3. <head>
  4. <!--
  5. New Perspectives on JavaScript
  6. Tutorial 3
  7. Case Problem 1
  8.  
  9. The Lighthouse
  10. Author: Joh
  11. Date: November 14 2010
  12.  
  13. Filename: clist.htm
  14. Supporting files: lhouse.css, list.js, logo.jpg
  15.  
  16. -->
  17. <title>The Lighthouse</title>
  18. <link href="lhouse.css" rel="stylesheet" type="text/css" />
  19. <script type="text/javascript" src="list.js"></script>
  20.  
  21. <script type="text/javascript">
  22.  
  23. function amountTotal() {
  24.  
  25.  
  26. <script type="text/javascript">
  27.  
  28. function amountTotal() {
  29. var amountTotal=0;
  30. var total=0;
  31.  
  32. for ( amountTotal=0;amountTotal<=0;i++)
  33. var<=0; var=amountTotal+total )
  34. {
  35. document.write(i+ <"/br>" );
  36. }
  37. </script>
  38.  
  39.  
  40.  
  41. </script>
  42. </head>
  43.  
  44.  
  45. <body>
  46.  
  47. <div id="title">
  48. <img src="logo.jpg" alt="The Lighthouse" />
  49. The Lighthouse<br />
  50. 543 Oak Street<br />
  51. Delphi, KY &nbsp;&nbsp;89011<br/>
  52. (542) 555-7511
  53. </div>
  54.  
  55. <div id="data_list">
  56.  
  57. <script type+"text/javascript" // set up variables of rows and cellspaces
  58. document.write("<table border='1' rules='rows' cellspacing='0'>");
  59. <tr>
  60. document.write("<th>Date</th><th>Amount</th><th>First Name</th>");
  61. document.write("<th>Last Name</th><th>Address</th>");
  62.  
  63.  
  64. <script language="javascript">
  65.  
  66. for (counter=0; amountarray<=; counter->amount array+1);
  67. {
  68. document.write("<tr><td>"+amountarray+"</td><td>"
  69. +(counter+1)+"</td></tr>");
  70. }
  71. </script>
  72. </table>
  73.  
  74. else document.write("<tr class=’yellowrow’>”);
  75. <td>date</td>
  76. document.write("<td>”+date+”</td>”);
  77. document.write("<td class='amt'>”+amount[i]+"</td>");
  78. document.write("<td>”+firstName[i]+”</td>”);
  79. document.write("<td>”+lastName[i]+”</td>”);
  80. document.write("<td>”);
  81. document.write(street[i]+"<br />”);
  82. document.write(city[i]+", “+state[i]+” “+zip[i]);
  83. document.write("</td>”);
  84. document.write("</tr>”);
  85. }
  86. document.write(“</table>”);
  87. </script>
  88.  
  89. </div>
  90.  
  91. <div id="totals">
  92. <script type="text/javascript”>
  93. document.write("<table border=’1′ cellspacing=’1′>”);
  94. document.write"<tr><th> id=’sumTitle’ colspan=’2′>Summary</th></tr>”);
  95. document.write("<th>Contributors</th>”);
  96.  
  97. document.write("<td>contributions</td>");
  98. document.write("<td><tr>”+amount.length+”</td></tr>”);
  99. document.write("<th>Amount</th>”);
  100. document.write("<tr><td>$”+amountTotal()+”</td></tr>”);
  101. document.write("</table>”);
  102. </script>
  103.  
  104. </div>
  105.  
  106. </body>
  107. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement