$.ajax({ type: "POST", url: "handle.php", data: "n="+name+"&e="+email, success: function() { alert('It worked'); } });
Here is the easiest way to use it. This would simply send the two post-variables $ _POST ['n'] and $ _POST ['e'] to handle.php. Your form will look like this if your ajax is in the send () function:
<form id="form" onsubmit="send(this.name.value, this.email.value); return false;">
Mike soule
source share