Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-07-2006, 11:37 PM   PM User | #1
ruchirghildiyal
New to the CF scene

 
Join Date: Sep 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
ruchirghildiyal is an unknown quantity at this point
Question Need to wait for data to load

I have an island which says: <xml id="myXML" ondatasetcomplete="relatedRelationshipsComplete()" src async="false"></xml>

Now, I want to do the processing in the same function where I set the src.
When I say xmlRelatedRelationships.src = "URL"; the next line I say var tmp = myXML.selectSingleNode("//MYNODE"); At this line I get the Javascript error "The data necessary to complete this operation is not available".

I know I have to wait for the data to get loaded. Can something be put in between: myXML.src = "URL"; and var tmp = myXML.selectSingleNode("//MYNODE"); so that the code waits until the data is loaded and then carries on? I am putting an alert which solves the purpose but I do not want users to click on an alert and then view the data on the page .
ruchirghildiyal is offline   Reply With Quote
Old 09-08-2006, 05:39 PM   PM User | #2
rlemon
Senior Coder

 
Join Date: Apr 2005
Posts: 1,051
Thanks: 0
Thanked 0 Times in 0 Posts
rlemon is on a distinguished road
you need to have a callback function to handle the data after it loads.

in that function run your code.
__________________
public string ConjunctionJunction(string words, string phrases, string clauses)
{
return (String)(words + phrases + clauses);
}
<--- Was I Helpfull? Let me know ---<
rlemon is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:19 PM.


Advertisement
Log in to turn off these ads.