I can track mouse coordinates dynamically with this
$(document).ready(function()
{
$().mousemove(function(e)
{
$('p').html("X Axis : " + e.pageX + " | Y Axis " + e.pageY);
});
});
With this, the numbers change on each mouse move dynamically. What I want to do is to save all coordinates. It should save it onbeforeunload. How to save all numbers ? I am thinking of append an iframe onbeforeunload like
save.php?coords=162x412-143x716-678x12
How can I do this ?
Try something like this
var moves = [];
$().mousemove(function(e){
moves.push(e.pageX + "x" + e.pageY)
});
then
window.onbeforeunload = function() {
$.post( your_url , moves.join('-'));
}
try this approach...
a way of saving these coordinates in a hidden variable and calling that hidden variable values on the event "onbeforeunload" to obtain them and save necessary..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With