David Golightly wrote:
Quote:
googleA...@screenlight.com wrote:
Quote:
Quote:
see the following example. When I simplified the test case, I seem to
be getting an error I cant explain.......
<http://www.screenlight.com/maplab/xTest.html>
>
Hm. I'm seeing that this doesn't work with "for (var i in obj)" , but
does seem to work with "for (var i=0; i<obj.length; i++)" which is the
correct technique for looping through an array anyway.
>
I get the following output:
>
DEBUG: error in read
DEBUG: [object Object]
>
the first seems to be from "for (var i in obj)", the second from "for
(var i=0; i<obj.length; i++)". Same in Firefox and IE6.
>
1) thanks for the reply 2) Huh?
my script output shows a single iteration for the array, just as if
it say an object, not an array there...
I commented out the non-array tries for a moment. Are you sure of what
you are seeing? There should be 41 elements iterated through...
>
Ok, look at your code very closely here:
>
for (var i=0; i < gContainer.dSubs_J.fsDataA.length; i++) {
console.info( i);
gContainer.makeSubObjMarker( gContainer.dSubs_J.fsData[i]);
}
>
See the last line? You're indexing a nonexistent property (due to a
typographical error) and it's throwing an error which breaks you out of
your loop. That's why you're only seeing one. Using firebug I get
gContainer.dSubs_J.fsDataA.length == 41.
A typo! that's it, a missing capital A at the end of the variable
name...
thanks very much. I guess I am still getting used to the Javascript
kind of errors, you know, where I can call things that dont exist and
in some cases that is not an error, and creates no msg.
btw- the external, global scope completion routine was written because
I couldn't get some syntax right.. If there was a way to copy the
'data' param in the ioBind completion to a gContainer property
directly, I would be all eyes and ears