How can I get the value of the href attribute in a link to populate the _link() target url value using jquery?
This is the normal code:
<a href="http://www.mydomain.com/gallery/" onclick="_gaq.push(['_link', 'http://www.mydomain.com/gallery']); return false;">Gallery</a>
There are many links that need to be updated in this fashion.
You can create a class for the links you would like to run
_gaq.pushfor and then use jQuery live() to bind the click event to them.Give your links a class like
gaq:And use jQuery live() to give all links with this class the ability to run the push function on click.