By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,066 Members | 1,841 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,066 IT Pros & Developers. It's quick & easy.

Event/Timing problem when loading data from xml...

P: n/a
Hi,
I have a web page that loads some data from a series of xml files into
a series of arrays. After that, a series of function process that data
in the arrays for display on the web page.
The problem I am encountering is that in some cases that functions that
process the data
from the arrays for dispaly are being called before the arrays have
been created (i.e. they are still "undefined").

The functions loading the data from the xml files are called from the
onload event of the body tag. What I need to do is figure out how to
call the functions which process the data in the arrays at such a time
when I can be sure that the arrays are all loaded, or I need a way to
check and see if the arrays exist and if not wait until they do... But
I can't discover a good way to do this. Any ideas?

Best,
ezmiller

Jan 9 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
VK

ezmiller wrote:
Hi,
I have a web page that loads some data from a series of xml files into
a series of arrays. After that, a series of function process that data
in the arrays for display on the web page.
The problem I am encountering is that in some cases that functions that
process the data
from the arrays for dispaly are being called before the arrays have
been created (i.e. they are still "undefined").


It is like to buy white shoes first and then polish them with black wax
because you actually don't like the white color. No offence but the
logic and actions consecution is very similar. :-)

You don't need XML intermediary media. Actually you never need XML if
you plan to handle data *manually*.

....
<script type="text/javascript" src="data.php"></script>
....

where data.php (.jsp / .asp / .cgi / etc.) returns ready to use
JavaScript arrays or JSON objects (see <http://www.json.org>)

Jan 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.