I’m working on debugging some javascript, and keep running into a javascript [object] (e.g., whenI display an alert with the value, it dsplays as [object] or NaN). I’m trying to read the contents of this object. I know in Java, this would be a perfect job for deepToString(); Is there any javascript equivalent to that method?
Here’s the code generating the aforementioned object…
e = document.getElementById("contServer"); // contServer is an integer variable
var valueCS = parseInt(e.options[e.selectedIndex].value);
//Value CS is a four-byte variable calculated from e
Any ideas for a javascript way to ‘decode’ this object variable so I can see what’s actually inside?
Thanks
ok so after looking at your original html code
this is invalid html, below is how an option should look like
if you do the same code this will return 1000, which is the value attribute
if you have something like the below
your code will return 0, because value is set to 0. This should get you on your way to correct our code