简体   繁体   中英

Display different content in a div

I want to change the contents of a div When a user clicks on a link. To do that, I tried using the following code :

function openModal() {
    el = document.getElementById("modal");
    el.style.visibility = "visible";
}    

function showContent(id) {
    openModal();
    $("#modal").load("modal/id.php");
    return false;
}    

However, it doesn't change "modal/id.php" to "modal/something.php" and, in place of that, opens a file named id.php in the modal directory. How can I change that?

Not sure to understand what's your question. Perhaps this's the answer.

  1. PHP

      echo "This other text is inside a PHP script"; 
  2. HTML

在此处输入图片说明

Please provide the rest of your code. It sounds like it may just be an ID oversight.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM