开发者

jQuery capture href (heatmap/usability)

开发者 https://www.devze.com 2023-03-12 11:10 出处:网络
I want to create a heatmap from mousedown event, but before this i need to capture the A element on a website. Does anyone know how i could achieve this?

I want to create a heatmap from mousedown event, but before this i need to capture the A element on a website. Does anyone know how i could achieve this?

in short: if i click a link it should be doing the following:

    开发者_StackOverflow社区
  1. capture the link.
  2. wait for $.POST/AJAX request.
  3. go to the link


$('a').click(function(){
    $.ajax({
        url: '/analytics',
        type: 'post',
        data: {url: $(this).attr('href')},
        async: false
    });
}
0

精彩评论

暂无评论...
验证码 换一张
取 消