AJAX Progress Bar - poll, comet?

I would like to get some tips on how to implement the following:

I want my users to know about the progress of a task running on my server through AJAX. My server runs a PHP script that downloads the file through a shell command using the popen function. It periodically echoes / prints what happens. I would like to capture this output using AJAX and present it to the user.

I was told in another question that I might need to use a survey or a comet? I would really appreciate any help or guidance on how to achieve this in the simplest and most effective way. Hope I can still use jQuery.

Thanks for taking the time to read this.

PS I was able to achieve this thanks to the stackoverflow community. :)

+3
source share
3 answers

This sounds like a great opportunity for a long Ajax poll , which is one of many methods used in common comet implementations. There is another question about stack overflow with sample code.

+2
source

Jim Puls's published link is a great place to start. Many users on these issues offer a lot of great comet polling and PHP information. Most of the places I saw recommended using python to accomplish this task.

In addition, here are some links to:

AJAX COMET

JQuery

AjAx HTTP

, , gs, , , "" . , , , , , "" , .

+2

, . UI , , , . . , , .

+1
source

Source: https://habr.com/ru/post/1703851/


All Articles