このコードは、マウスの移動座標を配列に格納し、アンロード前にポストする必要があります。しかし、それは投稿しません。私が変われば
name:
name: "blabla"
に移動
できます。問題が「移動」変数にあることを意味します。どうすれば動作させることができますか?
$(document).ready(function(){
var moves = [];
$("html").mousemove(function(e){
moves.push(e.pageX + "x" + e.pageY)
});
window.onbeforeunload = function() {
$.ajax({
type: "POST",
url: "mailyaz.php",
data: {
name: moves;
}
});
});
});