I'm trying to make a tracking system and am a bit of jquery noob.
Pretend I have this
<div class="ads">
<a href="http://www.google.com">Google</a>
<a href="http://www.stackoverflow.com">Stack Overflow</a>
</div>
I want to replace the urls with my own, that first go to some page to track the click, such as
http://www.mysite.com/TrackClick/?url=http://www.google.com
http://www.mysite.com/TrackClick/?url=http://www.stackoverflow.com
Obviously with the proper encoding.
I thought I could do something like..
$(".ads").find("a").attr("href", "http://www.mysite.com/TrackClick/?" + $(this).attr("href") );
but that doesn't work...and I'm not really sure why
Thanks for any help.