Stopping periodically_calls_remote

I’ve seen a couple other people ask this type of question, but I haven’t
yet
seen a good response.

If your remote page has a periodically_calls_remote function in it, to
say
give status over the course of a long action, how does one stop it and
redirect to a new page at the end? I’ve tried doing a redirect in the
action that the periodically_calls_remote function calls, however that
results in the redirected page being rendered in the middle of my
document.
Is there any way to trigger it to stop, or force the page to redirect
somewhere else? I’ve tried figuring out how the upload_progress control
does it, but it seems to be doing some magic that I couldn’t quite work
out.

Anyone have any ideas?

Charles Comstock