aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes ajax synchronicity? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "ajax synchronicity?" Watch "ajax synchronicity?" New topic
Author

ajax synchronicity?

graham king
Ranch Hand

Joined: Dec 30, 2004
Posts: 133
I am using ajax to populate some combo boxes. Each relies on the other values. I found one box value could be used to populate two boxes. However, it appeared that the two calls overlapped and the resulting boxes where populated with the second finishing ajax call.

Wasn't there a way to make an ajax call block other javascript calls until it had finished what it was doing? Just for kicks: How 2 do it?

HELP PLEASES What am I missing?


write, revise, re-write, revise, again...<br />write, revise, re-write, revise, again...
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You look at the true/false argument in the open method.

It would be better to code it so you would not run into this problem. OO JavaScript is the way to go.

Eric
graham king
Ranch Hand

Joined: Dec 30, 2004
Posts: 133
Originally posted by Eric Pascarello:

It would be better to code it so you would not run into this problem. OO JavaScript is the way to go.


Eric, is there anyway you could give me an example of this?

raying:

Graham
graham king
Ranch Hand

Joined: Dec 30, 2004
Posts: 133
Need a refresher on the whole JavaScript paradigm. I had forgotten that a variable declared without the var signa automatically becomes a global variable. So, the onchange event was actually using the same request object and terminating with wichever finished first. Silly me. By changing the name of the declared variable I was able to get the desired results.




[ December 01, 2006: Message edited by: graham king ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ajax synchronicity?