1 回答

TA貢獻(xiàn)1840條經(jīng)驗(yàn) 獲得超5個(gè)贊
你可以用 AJAX 做到這一點(diǎn)。
創(chuàng)建根據(jù) single-people.php需要輸出帖子的文件,并在彈出窗口打開(kāi)時(shí)通過(guò) ajax 請(qǐng)求它。
例如(假設(shè) jquery)
<script>
function openPopup(id)
{
fetch('http://example.com?p='+id).then(
function(response){
$('#popup-content').html(response.body);
$('.popup').show();
});
}
</script>
<button onclick="openPopup(1)">Open popup #1</button>
<button onclick="openPopup(2)">Open popup #2</button>
<div class="popup">
<div id="popup-content"></div>
</div>
- 1 回答
- 0 關(guān)注
- 157 瀏覽
添加回答
舉報(bào)