2 回答

TA貢獻1877條經驗 獲得超1個贊
在 json 對象中寫入數據,請參見下面的代碼
function details(id)
{
var id = id;
// alert(id);
$.ajax({
type: 'POST',
url: 'show.php',
data: {id:id},
success: function(data)
{
alert("hi");
}
});
}

TA貢獻1772條經驗 獲得超6個贊
檢查您的網絡選項卡并檢查發送參數列表。你不得不提到數據類型 json
嘗試這個
function details(id)
{
var id = id;
// alert(id);
$.ajax({
type: 'POST',
url: 'show.php',
dataType: 'json',
data: {'id':id},
success: function(data)
{
alert("hi");
}
});
}
在你的 show.php
<?php
if (isset($_POST['id']))
{
$uid = $_POST['id'];
echo json_encode($uid);
}
?>
- 2 回答
- 0 關注
- 132 瀏覽
添加回答
舉報