EIW FALL 2004
Stupid JavaScript Tricks: JavaScript Object Property Lists Source


<script>

// Create a TABLE that contains all the properties of a named 
// object

function properties_table(objectname, object) {
  document.write("<table border=1 bgcolor=wheat><tr>");
  document.write("<td style='font-size: 18pt; font-weight: bold' colspan=2 align=center>");
  document.write("Properties of the <code>"+objectname+"</code> object</td></tr>");

  for (prop in object) {
     document.writeln("<tr><th>"+prop+"</th><td>"+
     object[prop]+"</td></tr>");
  }

  document.writeln("</table><p>");
}

properties_table("document",document);

properties_table("navigator",navigator);

</script>


EIW Fall 2004