javascript - Intercept mouse click coordinates on whole website -


i'm trying write javascript or jquery code in order intercept type of click inside website, whether performed on video, link, image , other page elements, every type of click (if possible distinguished between left , right button) on entire area of web page , save coordinate data, type of click , address of page in db via ajax call. has of idea of code it?

thanks all

a basic outline be:

$('*').on('click', function (e) {     // make sure event isn't bubbling     if (e.target != this) {         return;     }     // click somewhere     // example, make ajax request     $.ajax({         type: "post",         url: "ajaxurl.php",         data: { x: e.pagex, y: e.pagey }     })     .done(function( msg ) {         alert( "data saved: " + msg );     }); } 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -