jsファイルからphpファイルに変数を渡す方法。checker.jsからtest.phpに変数が必要です。
function SendData(id){
$.ajax({
type: "POST",
url: "test.php",
data: "id=" + id,
cashe: false,
success: function(response){
alert("Record successfully updated")
}
})
}
$(document).ready(function(){
SendData(10)
})
test.phpファイル
<?php
var_dump($_POST);
?>
index.html
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script src="checker.js"></script>
</head>
<body>
</body>
</html>