I'm trying to send mouse position to server with jquery $.ajax method but i can't make it right.
$(document).ready(function (e) {
var x = e.pageX;
var y = e.pageY;
$(document).mousemove(function () {
$.ajax({
type: "POST",
url: "get_position.php",
data: {
pos_x: x,
pos_y: y
}
});
});
});
this code crashes the browser .What is the right way to do this ?