title: JavaScript click event
body: <p>My browser (firefox) prevents any popup from loading, and loads links that open new windows in the current tab, unless I explicitly say I want the link to load on a new tab or window, with the appropriate shortcuts (for example, middle click on the link, or left click with <kbd>ctrl</kbd> pressed causes the link to open on a new tab, and <kbd>shift</kbd> + left click on a new window).</p>
  
  <p>I would like to create a javascript function <code>f()</code> that runs some code (meant to create the link address) when the link is pressed, and then loads the link that has been created, without removing the user experience described above.
  Right now what I have is something like <code>&lt;a href="javascript:void(0)" onclick="f()"/&gt;</code>, but middle click doesn't work (it instead loads the url <code>javascript:void(0)</code>) and neither do the other features described above.</p>
  
  <p>Do you have any idea as how to solve my problem ?</p>
  
  <p>Thanks.</p>