我想在用户单击链接时更改 div 的内容。为此,我尝试使用以下代码:
function openModal() {
el = document.getElementById("modal");
el.style.visibility = "visible";
}
function showContent(id) {
openModal();
$("#modal").load("modal/id.php");
return false;
}
但是,它不会将 "modal/id.php"
更改为 "modal/something.php"
,而是打开一个名为模态目录中的id.php
。我怎样才能改变它?
最佳答案
不太明白你的问题是什么。也许这就是答案。
PHP
echo "This other text is inside a PHP script";
HTML
关于javascript - 在div中显示不同的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24841549/