$.ajax({
type: 'POST',
url: 'ifpost.php',
data: ({
subject: '',
namefrom: ''
}),
success: function(msg){
alert('wow' + msg);
}
});
Remember to collect the variables the other side…
$subject = mysql_real_escape_string($_POST['subject']);
$namefrom = mysql_real_escape_string($_POST['namefrom']);
Another example
$.ajax({
type: "POST",
url: "callback.php",
data: "{'file':'dave', 'type':'ward'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
});
And then theres the $GET way…
$.get('api.php', 'client=mikescafe', function(data) {
...
});











