I don't think I am but maybe I'm judging this wrongly.
I call two functions:

readXml(...);
displayPlayer(...);

The second one uses the global var myarray but it's always undefined.

It must definitely be related to the timing of the asynchronous call
though. If I pass the values returned by the xml to a function
declared globally it receives the values fine but for some reason
displayPlayer() doesn't have access to the 'final' value of myarray.



On Jan 22, 12:44 pm, David Decraene <[EMAIL PROTECTED]> wrote:
> also If you do something like this (don't know if you do):
>
> var myarray = new Array();
>
> function readXml(){ ..ajax.. }
>
> function handleXML(xml) {   myarray[i] == ...}
>
> var x = myarray.length;
>
> then x will always be 0 because myarray.length get's executed before
> the ajax call returns success (asynchronous).

Reply via email to