I am working with jQuery AJAX. Using an AJAX call I invoke a PHP page. By default it returns a single value to the success
function of AJAX. However I want to retrieve multiple data individually. What can I do?
Here's the jQuery code with AJAX , which returns a single value:
function getTime(){
$.ajax({
type: "POST",
url: "test.php",
data: {
fd: sdate,
sd: edate
},
dataType: "text",
success: function(msg) {
$("#results").text(msg);
}
});
};
Test.php:
echo $days;
echo $hours;
echo $minutes;
echo $seconds;