...

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



nanko
08-13-2005, 06:47 PM
Hi,
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.
Nimish

Lerura
08-13-2005, 09: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.
or

<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

Ranger56
08-13-2005, 10: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.

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

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

Well...new windows are still really annoying.

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

Ranger56
08-14-2005, 12:00 AM
IMO it's hijacking the GUI :)

Kinda.

Tristan Gray
08-15-2005, 02: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