I am posting some data using ajax. I want to manipulate that data and return to to the calling jQuery script.
Here is my jQuery:
$.ajax({
type: "POST",
url: "somescript.php",
datatype: "html",
data: dataString,
success: function() {
//do something;
}
});
Here is my somescript.php on the server:
<?php
//manipulate data
$output = some_function(); //function outputs a comma-separated string
return $output;
?>
Am I doing this correctly on the server side, and how do I access the return string when the ajax call completes?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…