I was going to ask another question, but in tying it out I realised
there is a more fundamental question here..

Q: within a function, do the statements run in order? if one statement
is running will it move on to the next? I faintly recall reading
something about js not paying attention to order. But, thinking about
it throws declaring vars first out the window.

What I'm getting at is this, I have a function that runs some code to
post a form to an iFrame (for file upload) and submits it to a file
doing the 'work'. Then right after this I run an Ajax.Request to
refresh a div, reflecting the newly uploaded content.

I strongly feel that I need to know that the iFrame post needs to some
how let the app know it's done prior to running the Ajax.Request
refreshing the div.

Here's some code to show what I'm talking about. Sorry if this is very
elementary school, everyday I run into new challeges that push my
knowledge of js scripting.

Thanks for looking at this.... and not laughing tooo hard... :)

function updateStationDetails()
{

        var org_code = $F('ORG_CODE');

       // shouldn't we know this block is done before moving on??

        $('DETAILS_FORM').writeAttribute({method:"post",
action:"updateStation.cfm", target:"RSIFrame"});
        $('DETAILS_FORM').insert(new Element("iframe", {id: "RSIFrame", name:
"RSIFrame", style: "width: 0px; height: 0px; border: 0px;", src:
"blank.html"}));
        $('form').submit();

       // end non communicating block


      // this block needs to hang out until the above is done

new Ajax.Request('editStation.cfm?ORG_CODE='+org_code+'&'+cfSession,
      {
        method: 'get',
        onSuccess: loadStationDetails,
                onComplete: attachStationObservers,
        onFailure: function(r) {
          throw new Error( r.statusText );
        }
      }
    );
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to