Yoav Shapira schrieb:
> Hi,
> 
> On 3/6/07, Jake McGraw <[EMAIL PROTECTED]> wrote:
>> Then you could use this:
>>
>>> $(function(){
>>>         $("a").click(function(){
>>>                $.get($(this).attr("title"));
>>>                return true;
>>>         });
>>> });
>> and have your anchors look like this:
>>
>> <a href="whateverURL" title="trackingURL">Text here</a>
>>
>> Function passed to click() scope "this" to the current element, in your case
>> an anchor.
> 
> Sweet, thanks!
> 
> Yoav
> 

This is a little obtrusive, as all your tracking URLs will be shown as 
tooltip to the user.

I'd do that:

var track = {
     'whateverUrl1': 'trackingUrl1',
     'whateverUrl2': 'trackingUrl12'
}

$(function() {
     $("a").click(function() {
         $.get(track[this.href]);
         return true;
     });
});

Besides, if you leave the page, there's no guarantee that the track 
request is indeed send to the server and not aborted on unload.


-- Klaus

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to