我有一些jQuery/PHP代碼,它使用Ajax來調用另一個頁面。php ajax成功:函數(味精) - 獲取味精
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.');
}
});
但是,我該如何獲得味精的價值?例如如果do_history.php只是:
<?php
$text="text";
return $text;
?>
會'味精'不是「文本」,所以當我提醒(味精);我會在屏幕上彈出「文本」。
我需要做什麼才能返回字符串值?有任何想法嗎?
感謝,