You can pass in POST variables as follows with key=value pairs thusly:
$.ajax({
type: "POST",
url: "some.php",
data: "name=John&location=Boston",
success: function(msg){
alert( "Data Saved: " + msg );
}
});
or using an object
var ref_num_url = "http://yourserver/cgi-bin/refnum.pl";
$.ajax ({
url: ref_num_url,
type: "POST",
data: { "environment": 'TEST', "blah": "foo"},
dataType: "xml",
success: function(myxml){
// this says using the returned xml find the
// refnum element and give me the text in it
// e.g 1234567 returns 1234567
alert($( myxml, "refnum").text());
}
}); // end ajax
0 Comments