JavaScript - Show/Hide Without Refreshing Page
<p>Can anyone help? I want to only show the script output if a particular application variable is true, without refreshing the page, as initially, the application variable could be false</p>

<pre><code>&lt;body&gt;
&lt;div id="output"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
var quotes = new Array(
'Quote 1',
'Quote 2',
'Quote 3'
);
function rotate() {
    quote = quotes.shift();
    quotes.push(quote);
    document.getElementById('output').innerHTML = quote;
    setTimeout("rotate()", 2000);
}
rotate();
&lt;/script&gt;
&lt;/body&gt;
</code></pre>
