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);
}