Silva altepeter.net Not logged in.

Family

Videos

Technology Stuff

Articles

Fun

Silva Products

Web Design

VIVO Javascript Framework

Photo Galleries

Contact Us

Blog

Debug function for javascript

Here is a debug function in javascript that appends a div to the end of the document containing the debug message.  I got this snippet from Guido Wesdorp.

debug(msg) {
 var div = document.createElement('div');
 div.appendChild(document.createTextNode(msg));
 body.appendChild(div);
}