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.
精彩评论