1$("button").click(function(e) {
2 e.preventDefault();
3 $.ajax({
4 type: "POST",
5 url: "/pages/test/",
6 data: {
7 id: $(this).val(), // < note use of 'this' here
8 access_token: $("#access_token").val()
9 },
10 success: function(result) {
11 alert('ok');
12 },
13 error: function(result) {
14 alert('error');
15 }
16 });
17});