Debugging idea
I got tired of clicking OK on a dozen alert statements when I was trying to debug some troublesome javascript, so I came up with this simple alternative:
So long as you have an element with an ID of "dump", e.g.
You can view the values of troublesome variables on the page like so:
function dump(descr,value) {
// This function dumps javascript data to the page, if a place for it exists.
if (document.getElementById("dump"))
document.getElementById("dump").innerHTM L+=descr+": "+value+"<br>";
}So long as you have an element with an ID of "dump", e.g.
<div id="dump"></div>You can view the values of troublesome variables on the page like so:
dump("troublesomeVar",troublesomeVar);