When generating static pages in batches, it is really uncomfortable not to know the progress information. I searched for a long time on the Internet and could not find a suitable free learning ajax progress bar.
In order to realize this function, I had to learn ajax from scratch. It took three days from learning ajax to now. Finally got some tips. However, because I am just learning and my strength is limited, I can only reluctantly write such a rubbish program. I hope everyone can expand it together.
Part of the code for this example comes from the Internet, plus some modifications and extensions of mine. I would like to express my gratitude and statement.
This code is completely open source and anyone can use and extend it for free. I hope everyone can share and communicate.
In fact, this code is an idea, which can be slightly modified to display the progress of any long-term task, not just batch-generated static pages.
This example uses an iframe to jump to the execution page. The execution page writes information to gaga.txt in real time, and ajax reads the txt content in real time and displays it in the foreground using js.
Since I haven't fully understood some features of ajax, this example has a regrettable loophole, that is, an error will occur if the page is refreshed midway through the program. However, if you don't mess around, you can still make do with it. I hope some expert can correct me and help me fix this loophole. I would be very grateful. If you can help me make it up, please contact me. Thank you again.
Expand