I have a catalog with several pictures, and I want to press one of those pictures and, without leaving the page I'm at, change the Full Image in one of my DIvs.
After searching the internet, I've found this:
<a href="imagem(@picture.FullSizeImageUrl" ... >
<img src="@picture.ImageUrl" ... />
</a>
that should connect with this javascript function:
function imagem(txt) {
document.getElementById("imagemgrande").innerHTML = "<img src='" + txt + "' alt=''/>"
sending the image I want to my div with ID imagemgrande.
When I run the code and hover the image, the link that shows in the bottom of the browser gives me the correct path to the image I want to show (meaning the the java function should receive the correct path) but when I click, it doesn't do anything. I thought that the image tag could be wrongly created, and put a alert(txt) before the document.getElementByID. It doesn't even register.
Am I forgetting something, am I not declaring the javascript variable txt?