Hi all,

Our goal is to track (by name) who clicked on specific links on our website.

We have a PHP login system to identify users. I have a simple list of links:

<ul id="linkList">
  <li><a href="#">Link One</a></li>
  <li><a href="#">Link Two</a></li>
  <li><a href="#">Link Three</a></li>
My Jquery script passes the name of the link via an AJAX GET request to the server:

$('#linkList a').click(function() {
	$.get('links.php', {'link': $(this).text()});
"links.php" simply inserts the link name and $_SESSION['username'] into a table in our database.

This works fine, until I edit one of the links to include an actual link (instead of just "#").

In other words, if I edit the first link to include a link to cnn.com like this:

<li><a href="http://www.cnn.com">Link One</a></li>
...clicking the link takes me to cnn.com, but the AJAX stuff is ignored. How can I do both, i.e., keep the link active AND do the AJAX call to the server?