Cancel Javascript timeout
<p>I have a long process hosted on a Web Server. The thing is triggered from a Web Page, at the click of a button by a user. Some Javascript polls regularly via Ajax to check if the operation has completed server side. To do this, I use <code>setInterval</code>, and later on <code>clearInterval</code> to stop polling.</p>

<p>If this takes too long (e.g. server has crashed), I'd like the client to be informed by some sort of timeout. I've done some research and found about <code>setTimeout</code>. Problem is, if the operation finishes successfully before the timeout, I'd like to cancel this one. </p>

<ol>
<li>How to do this ?</li>
<li>Would you suggest a different approach ?</li>
</ol>

<p>PS : I'm targetting <strong>IE7/IE8</strong> in particular, but always open to some <strong>JQuery</strong></p>
