So I have this site on which I have several divs. When you click on a div, a modal opens (OnClick). The modal's content is loaded remotely (modal body in another file). Within the remote link, I'm also delivering some data via GET. The data is different for each clickable div. Now if I click a div, the modal opens with the correct data. When I close that modal and try to open another one, the content displayed is still made with the data of the first clicked div. What seems to be the issue here?
That's about what I'm trying to do (simplyfied):
<div id="1" OnClick="openModal('modal_content.php?name=Peter')"></div>
<div id="2" OnClick="openModal('modal_content.php?name=John')"></div>
"openModal" is a selfmade function which opens the modal with the remote content (url in brackets). Now when I click on the first div, the modal should be
Hello Peter!
and the 2nd should be
Hello John!
First one clicked works fine. When I close that one and try to open the other, the content doesn't change.