PDA

View Full Version : Getting links to open up seperate pages


stag
04-03-2007, 12:20 PM
Hello

I have logos with image maps attained to them, but when you click on the image, the link opens the same page, thus away from the site. How do I make links open in there own page/browser?

Cheers
Stag

davidj
04-03-2007, 12:24 PM
target="_blank"

chriskq
04-04-2007, 01:26 AM
here is a better method (more reliable)


<a href="http://www.google.com.au" onclick="window.open(this.href);return false;">Link name</a>

Andromeda
04-04-2007, 03:23 AM
Why is it more reliable? I've never had any problems with the one david suggested.

chriskq
04-04-2007, 03:51 AM
the target event is html 4 (doc type)

I don't know about you but i code to Xhtml 1.0 Strict.
so thats why i use the onclick event. Using the target event would cause the page to not validate


sorry i shouldnt have said more reliable... just better practice in my opinion

Andromeda
04-04-2007, 04:56 AM
ok. another piece of info to store away :).