multiple xhr requests

E

Erich Lin

Hi I have a window that looks like this

--------------------
| | Enter
--------------------

That box will take a command that the user enters and runs it on a
server in the background loading a new window for the user to view the
results. Is there a way to take multiple xhr requests so that the next
request the user enters , a new window will pop up right away, instead
of stalling for the first xhr request to finish?

thanks
 
E

Erich Lin

also, i would like some of the commands to go on the same page so not
all of them will be on new windows
 
Z

zimbatm

Dear Lin,

your question is not very clear.

What you want is :
* Build an application, probably in rails (you should have asked on
that list btw).
* Use XmlHttpRequest (the xhr you mention) to submit some complex
operation.
* Operations should be non-blocking and return a value to the emitter.

What you need in your page, is two XHR. One that submits calculations,
and the second that periodically gets the results.

In your controller, you need two methods. "submit" and "response" for
example. Submit launches a new Thread in which it does the
calculations. Once finished, it fills the user's session for example,
or stores it in a class variable. Response looks in the sessions for
the results. Now I'll let you the pleasure of the implementation :)

Cheers,
zimbatm
 
E

Erich Lin

By multiple, I meant like the user clicks "enter", and then the user
types something else and clicks "enter". I would like thsoe XHR
requests to be handled simultaneously

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top