topical media & game development

talk show tell print

basic-ajax-02-Ch2-examp1.htm / htm



  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <title>Address Book</title>
  <style type="text/css">
  .ab {
          font-family: Verdana, Arial, Helvetica, sans-serif;
          font-size: small;
          color: #993300;
          background-color: #CCFFCC;
          padding: 5px;
          height: 100px;
          width: 350px;
          border: thin dotted #993300;
  }
  </style>
  <script type="text/javascript">
  function addrBook (fname, lname, email) {
  this.fname= fname;
  this.lname = lname;
  this.email = email;
  var adrbook = "<p class='ab'>First Name: " + fname + "<br />";
  adrbook += "Last Name: " + lname + "<br />";
  adrbook += "Email Address: " + email + "</p>";
  document.write(adrbook);
  }        
  </script>
  </head>
  
  <body>
  <script type="text/javascript">
  var aB1 = new addrBook('Roger', 'Williams', 'rwilliams@gmail.com');
  var aB2 = new addrBook ('Rose', 'Schultz', 'rose_s@earthlink.net');
  </script>
  </body>
  </html>
  
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.