Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <!--
- New Perspectives on JavaScript
- Tutorial 3
- Case Problem 1
- The Lighthouse
- Author: Joh
- Date: November 14 2010
- Filename: clist.htm
- Supporting files: lhouse.css, list.js, logo.jpg
- -->
- <title>The Lighthouse</title>
- <link href="lhouse.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="list.js"></script>
- <script type="text/javascript">
- function amountTotal() {
- <script type="text/javascript">
- function amountTotal() {
- var amountTotal=0;
- var total=0;
- for ( amountTotal=0;amountTotal<=0;i++)
- var<=0; var=amountTotal+total )
- {
- document.write(i+ <"/br>" );
- }
- </script>
- </script>
- </head>
- <body>
- <div id="title">
- <img src="logo.jpg" alt="The Lighthouse" />
- The Lighthouse<br />
- 543 Oak Street<br />
- Delphi, KY 89011<br/>
- (542) 555-7511
- </div>
- <div id="data_list">
- <script type+"text/javascript" // set up variables of rows and cellspaces
- document.write("<table border='1' rules='rows' cellspacing='0'>");
- <tr>
- document.write("<th>Date</th><th>Amount</th><th>First Name</th>");
- document.write("<th>Last Name</th><th>Address</th>");
- <script language="javascript">
- for (counter=0; amountarray<=; counter->amount array+1);
- {
- document.write("<tr><td>"+amountarray+"</td><td>"
- +(counter+1)+"</td></tr>");
- }
- </script>
- </table>
- else document.write("<tr class=’yellowrow’>”);
- <td>date</td>
- document.write("<td>”+date+”</td>”);
- document.write("<td class='amt'>”+amount[i]+"</td>");
- document.write("<td>”+firstName[i]+”</td>”);
- document.write("<td>”+lastName[i]+”</td>”);
- document.write("<td>”);
- document.write(street[i]+"<br />”);
- document.write(city[i]+", “+state[i]+” “+zip[i]);
- document.write("</td>”);
- document.write("</tr>”);
- }
- document.write(“</table>”);
- </script>
- </div>
- <div id="totals">
- <script type="text/javascript”>
- document.write("<table border=’1′ cellspacing=’1′>”);
- document.write"<tr><th> id=’sumTitle’ colspan=’2′>Summary</th></tr>”);
- document.write("<th>Contributors</th>”);
- document.write("<td>contributions</td>");
- document.write("<td><tr>”+amount.length+”</td></tr>”);
- document.write("<th>Amount</th>”);
- document.write("<tr><td>$”+amountTotal()+”</td></tr>”);
- document.write("</table>”);
- </script>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement