Using jquery / ajax I'm calling a php script which then runs a process which restarts apache2 on the server the pages are being supplied from.
I want the script to loop until a web page on the server is accessible (ie: apache2 has restarted) or x seconds expire.
Currently I use a setTimeout(function(){}
with a timeout of 10 seconds. This works but I feel it could be problematic, or the timeout could happen when apache2 hasn't restarted.
Anyone any ideas how I can create a jquery loop checking if a page is accessible or not, or timeout after say 10 seconds ?
Thanks