This is a discussion on "Target _blank" within the Web Page Design section. This forum, and the thread "Target _blank are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Target _blank
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
Target _blank
Is there a way to make all links on your site open in a new page without manually entering target="_blank" to them all?
Jack
__________________
Resources Administrator
Grilling Gurus - Interviews with the Best Web Designers and Developers in the Industry Got a Question for Ryan Carson and his Web Design/Development team Carsonified? Jack Franklin - My Blog (It's a Pen in My Mouth BTW)
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
|
|
|
|
||||
|
Re: Target _blank
ooohhh, why would you wnat to do this?
You should only be opening external links in a new window, internal links shold stay in the same one.
__________________
WelshStew Lead Administrator tierney rides tboard - uk site | xtreme wales - extreme clothing If you think I've helped, click the "Thanks" webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
|
|
||||
|
Re: Target _blank
It's for my ICT work. I have hundreds of links to pdf files with work in and they need to open in a new window if possible.
__________________
Resources Administrator
Grilling Gurus - Interviews with the Best Web Designers and Developers in the Industry Got a Question for Ryan Carson and his Web Design/Development team Carsonified? Jack Franklin - My Blog (It's a Pen in My Mouth BTW)
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
|
|
||||
|
Re: Target _blank
hhmmmm, place the following between your <head> tags and it should work:
Stew
__________________
WelshStew Lead Administrator tierney rides tboard - uk site | xtreme wales - extreme clothing If you think I've helped, click the "Thanks" webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
|
|
||||
|
Re: Target _blank
Yay it works! Thanks stew!
__________________
Resources Administrator
Grilling Gurus - Interviews with the Best Web Designers and Developers in the Industry Got a Question for Ryan Carson and his Web Design/Development team Carsonified? Jack Franklin - My Blog (It's a Pen in My Mouth BTW)
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
|
|
||||
|
Re: Target _blank
no probs
__________________
WelshStew Lead Administrator tierney rides tboard - uk site | xtreme wales - extreme clothing If you think I've helped, click the "Thanks" webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
|
|
||||
|
Re: Target _blank
does that make it apply to everything though?
is there a way to do this on just some links?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
||||
|
Re: Target _blank
Please remember for future purposes... the target="" attribute has been depreciated in strict doctypes.
|
|
||||
|
Re: Target _blank
Quote:
Didn't know that thanks marc
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
||||
|
Re: Target _blank
The best approach would probably use a small snippet of javascript and set rel="external" to the links you want opened in a new window. Its pretty snazzy from a validity and accessibility standpoint.
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
|||
|
Re: Target _blank
I wanted to open all <a></a> tags within a specific <div> on one of my sites. It was a live Ebay listing and when people clicked 'buy it now' I wanted them to stay on my page but open the Ebay link in another window.
Anyway, I stumbled upon this nifty piece of code: http://www.bennolan.com/behaviour/ |
|
|||
|
Re: Target _blank
Quote:
You're using javascript to sneak around the validator. That's silly: you get the "valid HTML" badge, but your HTML is actually invalid, because it uses target="_blank" (after being rewritten by javascript). If you try validating your generated source code, then it will fail. It also harms accessibility. Whatever fancy trick you use to implement target="_blank", it still takes control of the browser away from the user. If you want to write invalid HTML, just do it -- don't use a fancy trick to pretend it's valid. Last edited by MikeHopley; Oct 12th, 2007 at 09:59. |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Target Window Name | jayaramgussy | Web Page Design | 9 | Sep 20th, 2007 22:44 |
| The use of _blank... | 1840dsgn | Web Page Design | 11 | Jul 27th, 2007 23:40 |
| Validating target | Lchad | Web Page Design | 16 | Jan 18th, 2007 13:36 |
| XHTML Target | JacobHaug | Web Page Design | 7 | Jan 4th, 2007 11:55 |
| Frameset target help please | charter | Flash & Multimedia Forum | 4 | Mar 28th, 2004 10:05 |