keeping value of previous jquery global variable intact, even after onload
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/14139351/javascript-global-variable-does-not-persist-when-navigate-to-another-page-which">Javascript global variable does not persist when navigate to another page (which also uses same js file)</a>  </p>
</blockquote>



<p>I have a script</p>

<pre><code>&lt;script&gt;

var pn=0;

function set()
{
pn=parseInt(pn)+1;
}
&lt;/script&gt;
</code></pre>

<p>After the first execution of <code>set</code>, <code>pn</code> will be 1.</p>

<p>After the page is reloaded, <code>pn</code> retains its value of <code>1</code> so on the next execution of <code>set</code> it will be incremented to <code>2</code>.</p>

<p>How can I preserve global variables across page reloads?</p>
