<?php
if($_POST) {
if($_POST['ajx']) exit('Y');
else print_r($_POST);
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script>
$(function() {
$('form').on('submit', function(e) {
e.preventDefault();
$.post(location, $(this).serialize()+'&ajx=1', function(d) {
if(!!d) {
alert(d);
$('form').off('submit').submit()
}
})
})
});
</script>
</head>
<body>
<form method="post">
<input name="a" value="2" />
<button>GO</button>
</form>
</body>
</html>
Работает?