Javascript interrupt Page request
<p>I have a page that sends a request to the server. On the server we then send a synchronous request to a third party web API. Because of the call to the web API we never have complete control over how long our server side processing will take. So, what I would like to do is write a javascript function that will interrupt this page request and forward the user to an error page after so much time. So my javascript would look a little like this.</p>

<pre><code>function onSubmit() {
   var oneMinute = (60 * 1000);
   setTimeout(function(){ window.location.replace("http://errorPage.html"); }, oneMinute);
   return true;
}
</code></pre>

<p>The problem is that even when the timeout method is executed the page still waits for a response from the server before redirecting to the error page. Is there a way to interrupt the page request so that it doesn't wait until a response is received before redirecting to the error page?</p>
