• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ajax synchronicity?

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Or we might never have existed at all. Freaky. So we should cherish everything. Even this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic