I've been having some problems with a little piece of Javascript. I am completely new to the language, so bear with me. What the end goal is to have a few link on the left side of a table, when the user hovers over them, there will be a thumbnail image on the right hand side that appears. This I have using this code:

<script type="text/javascript" language="javascript">
function showPic (whichpic) { 
	if (document.getElementById) { 
		document.getElementById('placeholder').src = whichpic.href; 
		return false; 
	} else { 
		return true; 
	} 
}
</script>

but I also want that when a user clicks on the actual link, it will bring them to another webpage. Any help would be great!

<A HREF="javascript:void(0)"
onclick="window.open('URL')">
CLICK HERE TO OPEN NEW WINDOW</A>

IN THIS WAY YOU CAN EASILY OPEN A NEW WINDOW AT THE SAME TIME WHEN USER CLICK ON THE LINK

That worked sorta great! :)

I have it now where it shows the image on the mouseover, and when you click on the link, it brings up the web page in a new window, but unfortunately it also brings up the image since the a href is linked to the image. I wasn't sure if doing the A HREF="javascript:void(0)" would work because there is no reference to what image to show.

This is the code that I have for the link:

<a onmouseover="return showPic(this)" href="images/allservice.jpg" onclick="window.open('www.webpage.com')">Link Goes Here</a>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.