aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Parallel requests using AJAX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Parallel requests using AJAX" Watch "Parallel requests using AJAX" New topic
Author

Parallel requests using AJAX

Ashutosh Arya
Ranch Hand

Joined: Oct 07, 2008
Posts: 69
I am trying to call AJAX response in another AJAX call..but when I give some alerts only then it behaves in sequence otherwise not.

Please help me that how can make it to work in sequence.

Thanks in advance.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Could you ask that again, perhaps with a code sample (please UseCodeTags)? I don't understand what you're asking.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Build a queue system.

Eric
Ashutosh Arya
Ranch Hand

Joined: Oct 07, 2008
Posts: 69
Hi,

I have almost achieved what I wanted, but a small issue is when I am hitting the submit button and calling a function which in turn calls two ajax function the submit button dosent come back unless the calls are complete and remain pressed and the loading image is also not displayed. Below is the code:


If I give any alert message and haulting the process the loading image is displayed but as I click on ok of the alert again the system respondes only when all the calls are complete
Please let me know how can I display the loading Image in this scenario.

I have tried all but still as I press submit the button remains pressed until all the calls gets complted.It gives a feeling as the page is stuck which I dont want!

Please help

Thanks in advance

Aashu
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
font tags are depreciated. You should never use them.

Eric
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You should never use eval like that.

eJD = eval("verForm.jD"+i);

var foo = document.formName.elements["elemName" + yourVariable];


Eric
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You are making a sychronous call. It will lock up the browser and not allow anything else to happen. That is why your image is not loading.

Eric
Ashutosh Arya
Ranch Hand

Joined: Oct 07, 2008
Posts: 69
Thanks a lot Eric,

I will surely implement the changes but as far as Synchronous call is concerned I have to use that as when I am not using that the assingment to the global variable is not happening properly (as the calls are async) so I used it but still when I tried with async calls, when i press submit, the button is staying pressed until all the calls complete.

I have mentioned that when I stop the process by giving an alert in between anywhere in these methods the loading image is displaying.

Actually what is happening is when the submit button comes back from calls it quickly places both the images one after the other which finally shows successfully updated message.

That's a tricky thing I am unable to solve.

If you notice the function which is initially called is not an AJAX function, Is that making the difference? (As when I was using an AJAX function earlier the loading image was working fine)

Any suggestions?

Aashu
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parallel requests using AJAX
 
Similar Threads
Dealing with client-side changing of code
Sequence diagrams' details
No action for JSP
German characters can't be displayed by Ajax call
German characters can't be displayed in a web page.