$txt = $_POST["txt"];
if(empty($txt)){
$data="内容不能为空";
echo json_encode($data);
die;
}后端代码
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
data: "txt=" + txt 改成这样 data: {txt:txt}