Does javascript still execute if I navigate to a different page?
<p>Say I have a set-up like this:</p>

<pre><code>$('#mylink').click(function(event){
   savePost();
});

&lt;a id="mylink" href="http://google.com"&gt;my link&lt;/a&gt;
</code></pre>

<p>If I click the link will I be gone to a different page without giving the function a chance to execute?</p>

<p>What if savePost() has ajax and a callback function? Will it execute regardless of what page the browser is on when the script executes? (or would I have to preventDefault on the link and put the window.location command within the callback)</p>
