Excuse me for the very cryptic name but this is the weirdest (although very small) problem I've ever encountered.
I have a variable in JavaScript which I want to initialize to the int value of 5 to be later incremented in a function. Everything works perfectly until instead of declaring this value in the javascript, I instead pull it from the xml file and assign it to that variable.
This works...
var x = 5;
This doesn't...
var x = xmlDoc.getElementsByTagName("x")[0].childNodes[0].nodeValue;
The weird thing is that when I try to get the output at both by putting a
alert(x)
after the code they both say they are initialized to 5 so what is going on here?
A similar problem is when I get a number from xml, i.e. 20, then I add 1 to that number and then when I print it, the number has for no reason turned into 200.