View Full Version : Can you force new browser window for hyperlinks?

08-13-2005, 05:47 PM
I am using iframe in html pages. iframe basically gets data from database which may contain hyperlinks. My problem is any links within the iframe display the link-destination pages within the iframe. Also the data is input by the visitors have no idea on how to set target in hyperlink tag.

:o Is there a way via CSS or some other way to force any clicks on iframe links to open new browser window? Basically i want the customers open up new window for their any custom hyperlinks displayed in iframe.

;) thanks in advance for any help.

08-13-2005, 08:14 PM
You can insert one of these lines in your <head>

<base target="_blank">
which opens any link, that do not have target , in a hole new window.

<base target="something">
which opens the first clicked link in a new window and when you click another link it will open in the same window as the first

if this doesn't work try providing a link to your page so i can have a look at it

08-13-2005, 09:02 PM
<base> is most likely depracated.

just use this in any links in your iframe.

<a href="blach.html" targer="_blank">LINK</a>

But remember, the 'target' attribute is not valid in xhtml.

08-13-2005, 09:16 PM
But remember, the 'target' attribute is not valid in xhtml.
In XHTML 1.0 Transitional it is...

08-13-2005, 09:37 PM
In XHTML 1.0 Transitional it is...

Well...new windows are still really annoying.

08-13-2005, 10:47 PM
Well...new windows are still really annoying.
IMO it's hijacking the GUI :)

08-13-2005, 11:00 PM
IMO it's hijacking the GUI :)


Tristan Gray
08-15-2005, 01:02 PM
I personally prefer it. There are some links on a page that obviously the user will not want to leave the page yet such as a pdf file. When I browse I hate forums and websites that do not open links externally. Sure you won't be able to validate as strict doctype... but it doesn't stop you from using the strict doctype anyway and if everything else validates I say go for it.

target="_blank" is the easiest way to open a page in a new window, knock yourself out.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum