I'm looking for some JS which which can run a php script in a loop until it returns a success message. Also, it should display a loading gif while the php runs (takes a few seconds). It should all be triggered by a href link.
I know very little about JS, and as such I have been trying to find bits and pieces of code on forums to assemble a working script - needless to say, without much luck.
If anyone could post me a working example of something similar, it would be a huge help. Especially the part where it should stop refreshing/retrieving the output when the php outputs a success message.
Also, please let me know if this is not the right forum/section.