title: Create a dual function html Url Link?
body: <p><strong>Problem:</strong></p>
  
  <p>You have a regular set of URL links in a HTML page e.g.:</p>
  
  <pre><code>&lt;a href="/foo/bar"&gt;Foo Bar&lt;/a&gt;
  </code></pre>
  
  <p>You want to create a JavaScript function such that when any HTML links are clicked, instead of the client's browser navigating to that new URL "/foo/bar" a JavaScript function is executed instead <em>(<strong>e.g</strong>. this may for example make an Ajaxian call and load the HTML data without the need to reload the page)</em>.</p>
  
  <p>However if the JavaScript is <strong>disabled</strong> OR a <strong>spider</strong> crawls the site, the UTL links are maintained gracefully.</p>
  
  <p>Is this possible? Does it already exist? What's the usual approach? </p>
  
  <p><strong>EDIT 1:</strong></p>
  
  <p>These are some great answers! </p>
  
  <p>Just a follow on question:</p>
  
  <p>If the user clicks on the back button OR forward button, this would naturally break (as in it would go back to the last physical page it was on as opposed to one that was loaded).</p>
  
  <p>Is there any way (cross browser) to maintain the back/forward buttons?</p>
  
  <p>(e.g create an array of links clicked and over ride the browser buttons and use the array to navigate)?</p>