user3410806
user3410806

Reputation: 15

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?

Upvotes: 0

Views: 72

Answers (2)

paulmz
paulmz

Reputation: 213

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

Upvotes: 0

Salathiel Genese
Salathiel Genese

Reputation: 1909

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

enter image description here

Upvotes: 1

Related Questions