开发者

jQuery detect user actions on page

I want to track 开发者_运维技巧user actions on a page using jQuery. I track now the $(document).ready event. I would like to track if the user navigated to another page. Can I do that using jQuery?


$(document).ready(function() {
  $('a').click(function() {
     var navigatedUrl = $(this).attr('href');
     // do something with url here
  });
});


There's also $(window).unload. Though it seems easier if you were just to track the movement via a session id and log the page views on the server.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜