ajaxを使用して別のページを呼び出すjquery/phpコードがあります。php ajax success:function(msg) - msgを取得するmsg
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.');
}
});
ただし、msgの値を得るにはどうすればよいですか?例えばdo_history.phpが単純である場合:
<?php
$text="text";
return $text;
?>
'MSG' は "テキスト" ので、私は警告(MSG)ではありません。私は "テキスト"私の画面上にポップアップを取得します。
文字列値を返すには何が必要ですか?何か案は?