Hello everyone! =)
I’m strugling with this for hours, please help!!!
I’m building javascript application that uses the web service to fetch x and y coordinates, and then draw points on the map. Should be very simple. Part of my code looks like this:
…
261 var xPos = data.LastState[0].GeoX.toString();
262 var yPos = data.LastState[0].GeoY.toString();
263 var pt = { x: xPos, y: yPos };
…
I’m using IE8 for testing. I’m constatntly getting the same error: Line 261 – data.LastState.0.GeoX is null or not an object. Fine, that’s quite possible to happen, the problem is when i try to filter those null results out. I tried the following:
if (data.LastState[0].GeoX == null)…
if (data.LastState[0] == null)…
if (data.LastState == null)…
if (data == null)…
if (data.LastState[0].GeoX == undefined)…
if (data.LastState[0] == undefined)…
if (data.LastState == undefined)…
if (data == undefined)…
Every single one of these conditional statements evaluates to false, yet the “data.LastState.0.GeoX is null…” error raises.
Moreover, i did this:
alert(data.LastState[0].GeoX) – this returns 17.4345430 or something similar, not null or undefined or empty alert or anything.
How is that possible???? How can this happen:
260: alert(data.LastState[0].GeoX); //17.4345430
261: xPos = data.LastState[0].GeoX; //data.LastState.0.GeoX is null or not an object!!!
Please help!!!