Weird Thoughts From Eric's Head

Tags - Categories : All | AJAX | BUSINESS | PERSONAL | PROGRAMMING | BOOK REVIEW

Print The DOM Node Tree
A user on one of forums posted this link: http://www.permadi.com/tutorial/domTree/index.html to a tutorial on the DOM Node. The script there is rather interesting to anyone that does not understand the structure of a document.

An example output from the script with IE6 is:

<HTML>
  ¦
  ¦--<HEAD>
  ¦  ¦
  ¦  ¦--<TITLE>
  ¦  ¦   </TITLE>
  ¦   </HEAD>
  ¦
  ¦--<BODY>
  ¦  ¦
  ¦  ¦--<TABLE>
  ¦  ¦  ¦
  ¦  ¦  ¦--<TBODY>
  ¦  ¦  ¦  ¦
  ¦  ¦  ¦  ¦--<TR>
  ¦  ¦  ¦  ¦  ¦
  ¦  ¦  ¦  ¦  ¦--<TD>
  ¦  ¦  ¦  ¦  ¦  ¦
  ¦  ¦  ¦  ¦  ¦  ¦--[unknown tag]
  ¦  ¦  ¦  ¦  ¦  ¦  
  ¦  ¦  ¦  ¦  ¦   </TD>
  ¦  ¦  ¦  ¦   </TR>
  ¦  ¦  ¦  ¦
  ¦  ¦  ¦  ¦--<TR>
  ¦  ¦  ¦  ¦  ¦
  ¦  ¦  ¦  ¦  ¦--<TD>
  ¦  ¦  ¦  ¦  ¦  ¦
  ¦  ¦  ¦  ¦  ¦  ¦--[unknown tag]
  ¦  ¦  ¦  ¦  ¦  ¦  
  ¦  ¦  ¦  ¦  ¦   </TD>
  ¦  ¦  ¦  ¦   </TR>
  ¦  ¦  ¦   </TBODY>
  ¦  ¦   </TABLE>
  ¦   </BODY>
   </HTML>

I guess my geek in me things this is cool.
Hope this helps you out.

Eric Pascarello
Moderator of HTML/JavaScript at www.JavaRanch.com
Author of: JavaScript: Your Visual Blueprint for Dynamic Web Pages