SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2007
    Location
    delhi
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Tracing the XML value outside a function



    AS STRUCTURE ::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    function loadXMLKey(loaded) {
    if (loaded) {
    xmlNodeKey = this.firstChild.firstChild;
    VARDATA = xmlNodeKey.firstChild.firstChild;
    }
    /* ====Showing the value inside the function==== */
    trace(VARDATA);
    }
    xmlKey = new XML();
    xmlKey.ignoreWhite = true;
    xmlKey.onLoad = loadXMLKey;
    xmlKey.load("list.xml");
    /* ====Not showing the value outside the function==== */
    //*== Want to trace the value of VARDATA here == */
    trace(VARDATA);


    XML STRUCTURE ::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    <?xml version="1.0"?>
    <vlist>
    <vset>
    <valuev>TraceMe</valuev>
    </vset>
    </vlist>
    Attached Files Attached Files

  2. #2
    SitePoint Wizard jim_morrison3's Avatar
    Join Date
    Apr 2004
    Location
    UK
    Posts
    2,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you trace the value of loaded ? Is it returning true ? Also the value of trace outside the function will NOT return anything (or as undefined), this is because the trace statement outside the function is getting called before the function is executed and the function will get executed only when the xml file is loaded.
    Good Luck!
    There are things known and Things unknown
    And in between are the Doors.
    I love hand Coding.

  3. #3
    SitePoint Member
    Join Date
    Aug 2007
    Location
    delhi
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so wt to do ?


Bookmarks

Posting Permissions

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