• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Match Ajax responses with requests

 
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some elements in a browser page fire Ajax requests to a server witch I have no control.
When I got the responses back, how do I know witch response is associated with witch firing element?

Thanks.
Bruce
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Teach yourself about OO JavaScript.

Eric
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the clue.
Note that I have no control of the server application that generates the response (I cannot send a Id or some sort to server and ask server to send me this Id back).
Is there a way to associate the response to the element that triggered the Ajax?
Thanks.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it is OO on the client, there is no need to pass an id to the server since you object would have this information already.

http://java.sun.com/javascript/ajaxinaction/Ajax_in_Action_ApB.html

Eric
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Eric.
I have both Ajax In Action and Ajax in Practice books.
Now I will read them in more detail!
Thanks,
 
Marshal
Posts: 67280
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you have Ajax in Practice, pay special attention to chapter 4 where you will see how using a library like Prototype or jQuery makes it very easy to make Ajax calls in an OO fashion. Each request can easily be associated with separate handler functions that will keep your request threads under control.
 
Why does your bag say "bombs"? The reason I ask is that my bag says "tiny ads" and it has stuff like this:
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!