how to track Variable without using old-school alert('variable'); ..?
i'm returning, or trying to get back into JS programming.
what's a better way to track a variable, better than using alert('variable')?
trying to catch up here.
if you use an interval
then you could update the inner html of a "debugging" div.
Hope that makes sense.
Here is a small example::
<html lang = "en-US">
<body onload = "DoIt()">
<div id = "debugger" style = "left: 5%; top: 5%; height: 100px; width: 100px; position: absolute; background: #EEEEFF;">
var x = 0;
var Debug = document.getElementById("debugger");
Debug.innerHTML = x;
IntervalID = setInterval(countup, 1);
I use the Firefox tools as well. Highly informative!
Don't forget about console.log(). It will give you a detailed breakdown of the contents of any variable; its particularly useful for objects (ie arrays)
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)