This is more relevant for your question: http://docs.jquery.com/Ajax/jQuery.post
Report the results of the test.php query (HTML or XML, depending on what was returned).
$.post("test.php", function(data){ alert("Data Loaded: " + data); });
View the results of the test.php query with additional data payload (HTML or XML, depending on what was returned).
$.post("test.php", { name: "John", time: "2pm" }, function(data){ alert("Data Loaded: " + data); });
Gets the contents of the test.php page, stores it in the XMLHttpResponse object, and applies the JavaScript function of the process ().
$.post("test.php", { name: "John", time: "2pm" }, function(data){ process(data); }, "xml");
Gets the contents of the test.php page that was returned in json format ("John", "time" => "2pm")) ;? >)
$.post("test.php", { func: "getNameAndTime" }, function(data){ alert(data.name);
source share