Prevent Javascript Page Reload
<p>I am using this javascript to auto refresh a page every 30 seconds. </p>

<pre><code>&lt;script type="text/javascript"&gt;
    window.setTimeout(function(){ document.location.reload(true); }, 30000);
&lt;/script&gt;
</code></pre>

<p>I need to give users an option to disable this function at any time before the page is reloaded.</p>

<p>Note: this is for an admin panel, not a public website, and the requirement from the client is that the page auto refreshes, with an option to stop the refresh before it happens by clicking a button. </p>

<p>Is there any way to achieve this... That is.. disable the javascript before it executes?</p>