Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AJAX and infinite loop script

Status
Not open for further replies.

nababx

Programmer
May 5, 2008
2
IE
Hi,

Do you know if I can launch a PHP script kept-alive by an infinite loop (it's a socket client script) through AJAX without blocking the other JS commands coming afterwards?

The idea is that a script is always launched, and sends returns data only when needed, and we execute this returned string little by little as it is returned on the ReadyState=3.
I am doing this to implement a chat and an alert system using socket connections, in an existing PHP application which works only through AJAX. So there are JS messages all the time.

I have made quite a lot of tries, but so far, even if the chat server sees the connections, on the client side, the script execution blocks anything which comes after - so the app is blocked.

I have seen a few posts discussing the problem, but none came with a solution. Some suggested to use a Flash interface, which I'd like to avoid, others say that IE doesn't respond to ReadyState=3.
Does any of you know more?

If you wanna have a look at the code, it is there:

Thanks for your help!

Thomas
 
Look at setTimeout and setInterval to call functions after time periods you specify.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top