I have some jquery/php code which uses ajax to call another page.
var pall_id = $(this).attr('id');
$.ajax({
type: "POST",
url: "do_history.php?pall_id="+pall_id,
success: function (msg) {
alert (msg);
},
error: function (XMLHttpRequest, textStatus, errorThrown)
{
alert('Error submitting request.');
}
});
However what do I do to get the value of msg? e.g. if do_history.php is simply:
$text="text";
return $text;
?>
would 'msg' not be "text" so when I alert(msg); I would get "text" popping up on my screen.
What do I need to do to return a string value? Any ideas?
Thanks,