Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2006
    Thanked 0 Times in 0 Posts

    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 .

  2. #2
    Senior Coder
    Join Date
    Apr 2005
    Thanked 0 Times in 0 Posts
    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 ---<


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts