test.html
<button>テスト</button>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$('button').click(function () {
// Ajax通信を開始する
$.ajax({
type: "POST",
url: '/action',
success: function() {
console.log('成功');
},
error: function(){
console.log('失敗');
}
})
});
});
</script>