Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 12-20-2007, 04:41 PM target="_blank"
Colin's Avatar
Average Talker

Posts: 27
Name: Colin Smiley
Trades: 0
Hey...I want to know if there is a way to achieve the effect of the target="_blank" tag in xhtml 1.0 strict? I would rather not use javascript so please let me know if there is another option...Thanks...
Colin is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-20-2007, 08:56 PM Re: target="_blank"
coolkbk585's Avatar
Be good this Christmas!

Latest Blog Post:
KBlog has been deativated
Posts: 642
Name: Kyle
Location: Ada, MI
Trades: 0
Does target="_blank" not validate? I think it should...it's not a depreciated code...
__________________
<?php if($Adsense_Revenue > 0): define('HAPPINES','100%'); else: define('HAPPINESS', '0%') endif; ?>
coolkbk585 is offline
Reply With Quote
View Public Profile Visit coolkbk585's homepage!
 
Old 12-20-2007, 09:05 PM Re: target="_blank"
joder's Avatar
Flipotron

Posts: 6,442
Name: James
Location: In the ocean.
Trades: 0
http://www.w3.org/MarkUp/2004/xhtml-faq#target
Quote:
Why was the target attribute removed from XHTML 1.1?

It wasn't. XHTML 1.0 comes in three versions: strict, transitional, and frameset. All three of these were deliberately kept as close as possible to HTML 4.01 as XML would allow. XHTML 1.1 is an updated version of XHTML 1.0 strict, and no version of HTML strict has ever included the target attribute. The other two versions, transitional and frameset, were not updated, because there was nothing to update. If you want to use the target attribute, use XHTML 1.0 transitional.


target is not a part of any strict specification. You need to use javascript to achieve this.
joder is offline
Reply With Quote
View Public Profile
 
Old 12-20-2007, 10:46 PM Re: target="_blank"
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Joder is exactly right, it is not valid for a Strict doctype. The question becomes - why are you opening up a new window anyway ?
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 01:19 AM Re: target="_blank"
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
2 solutions:
Extend the doctype to support it:
http://blog.codexpress.cn/xhtml/usin...tml-10-strict/

Add a bit of javascript that will emulate it through DOM manipulation:
http://www.sitepoint.com/article/sta...ompliant-world (page 3 for the script)

Although I would recommand you the 2nd solution. Put a rel="external" on your links, and have the sitepoint javascript ran on pageload to alter the dom to opne those links in a new window.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 12-21-2007, 02:14 PM Re: target="_blank"
Truly's Avatar
Ultra Talker

Posts: 322
Trades: 0
Thats terrible. Why would they take that feature away from us? And realistically does it matter if you conform to strict standards unless you are targeting cellphones or other handheld/wireless devices with limited processing. I know you experts are cringing at my disregard for standards, and maybe I am killing the internet, but so what? :P

It seems almost as if they are forcing developers to learn JS. Im still in the process of mastering PHP, I cant take the time to learn JS now too. Is it really that bad if he just chooses transitional so he doesnt have to use JS?
Truly is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 02:24 PM Re: target="_blank"
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Nobody has "taken the feature away"

It was never really there in ANY DTD other than a frameset DTD

The target attribute value has no meaning intrinsically unless there are named frames to send the page content to.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-21-2007, 02:25 PM Re: target="_blank"
joder's Avatar
Flipotron

Posts: 6,442
Name: James
Location: In the ocean.
Trades: 0
Quote:
Originally Posted by Truly View Post
Thats terrible. Why would they take that feature away from us? And realistically does it matter if you conform to strict standards unless you are targeting cellphones or other handheld/wireless devices with limited processing. I know you experts are cringing at my disregard for standards, and maybe I am killing the internet, but so what? :P

It seems almost as if they are forcing developers to learn JS. Im still in the process of mastering PHP, I cant take the time to learn JS now too. Is it really that bad if he just chooses transitional so he doesnt have to use JS?
No one is forcing you to use the Strict specification. Use Transitional. The browsers support transitional and it's not going away anytime soon.

Personally, I think pop-up windows are only good in rare instances such as to assist in finding information to put in a form (using javascript, not target). Most other times, I just close the window and if there are too many, remember never to return to that site again. Hopefully, pop-up blockers will keep in step.
joder is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 02:32 PM Re: target="_blank"
johneva's Avatar
Super Talker

Latest Blog Post:
Mercedes- Benz SLK
Posts: 139
Location: Stafford, England
Trades: 0
The idea is it should not be the webmaster who makes the sites choice on wether a new window is opened but the users choice, nothing I hate more than being on a site which keeps opening new windows for me. If I want it in a new window or a new tab I am more than caperble of making it do it myself I dont need the websites coding to do it for me.

Everybody who decided they where going to instead start using Javascript to make things open in a new window are all just cheating the idea of giving window opening control back to the user instead of the webmaster.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

Last edited by johneva; 12-21-2007 at 02:34 PM..
johneva is offline
Reply With Quote
View Public Profile Visit johneva's homepage!
 
Old 12-21-2007, 02:39 PM Re: target="_blank"
Truly's Avatar
Ultra Talker

Posts: 322
Trades: 0
I agree with letting the user decide BUT what about on a webforum like webmaster-talk? You can have users click a link and then be taken away from the forum, often times the user is just looking at the site for reference to whatever they are talking about.

Now maybe this site is a bad example because we all know the shortcuts to opening new tabs/windows quickly but alot of people dont.

Quote:
No one is forcing you to use the Strict specification. Use Transitional. The browsers support transitional and it's not going away anytime soon.
Then why use strict ever if its just going to limit functionality? Just to speed up load times and to ensure 99.9% compatibility?
Truly is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 02:45 PM Re: target="_blank"
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Another JS method for opening new windows (if you must):
http://www.456bereastreet.com/archiv...pt_version_12/

Then we have the reasons why it's a BAD idea to do it. The Scourge of New Windows
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 03:01 PM Re: target="_blank"
johneva's Avatar
Super Talker

Latest Blog Post:
Mercedes- Benz SLK
Posts: 139
Location: Stafford, England
Trades: 0
Quote:
Originally Posted by Truly View Post
I agree with letting the user decide BUT what about on a webforum like webmaster-talk? You can have users click a link and then be taken away from the forum, often times the user is just looking at the site for reference to whatever they are talking about.

Now maybe this site is a bad example because we all know the shortcuts to opening new tabs/windows quickly but alot of people dont.


Then why use strict ever if its just going to limit functionality? Just to speed up load times and to ensure 99.9% compatibility?
Well I dont even need to put a reply cosmost of it has been answred for me by the article posted above, take a good read.

As for why use strict there are many reasons I wont get into them and it is easy to find the answer if you look, but think of it this way times change and although its only in strict ATM and you can get away with it in transitional do you think it will always only be like this?

Same old thing with computers you get people who just dont want to learn new stuff they like the old way but sooner or later the old way carnt be done anymore and they have to laern the new way.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

Last edited by johneva; 12-21-2007 at 03:03 PM..
johneva is offline
Reply With Quote
View Public Profile Visit johneva's homepage!
 
Old 12-21-2007, 10:48 PM Re: target="_blank"
Truly's Avatar
Ultra Talker

Posts: 322
Trades: 0
/me has been happily put in his place

Thanks for the insight
Truly is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 11:28 PM Re: target="_blank"
Colin's Avatar
Average Talker

Posts: 27
Name: Colin Smiley
Trades: 0
Well I am doing it for like sites I link to, they open in a new window or new tab...
Colin is offline
Reply With Quote
View Public Profile
 
Old 12-22-2007, 12:01 PM Re: target="_blank"
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
Well I am doing it for like sites I link to, they open in a new window or new tab...
Why ? Do you think you're keeping people on your site ? That's not a good reason. Usability studies show that people DO know how to use their BACK button and they do so easily .. and liberally. That old 'keep 'em on your site' is just that .. OLD - it's bad for accessibility and usability. Don't try to control your visitors, they don't like it and may not come back.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-23-2007, 06:01 AM Re: target="_blank"
Experienced Talker

Posts: 30
Trades: 0
lol, opening linkpartners in a new tab is normal I guess..
Look: if someone of you gave a link to his website here, and I click it, I would like it to open in a new tab and not in the same window...
klaroen is offline
Reply With Quote
View Public Profile
 
Old 12-23-2007, 12:22 PM Re: target="_blank"
johneva's Avatar
Super Talker

Latest Blog Post:
Mercedes- Benz SLK
Posts: 139
Location: Stafford, England
Trades: 0
Well not really no if I am looking at links to leave your site then why would I want it in a new window? If I do decide I want to go back to your site then all I have to do is press the back button, where as if I open a new window mooch around and want to go back, I would have closed the old window and now lost my way back to your site.

I am one of these who dont like 1000 windows open on my computer it something opens in a new window I close the old one, which then means as I already said if I do decide to go back to your site you have actually made it harder for me by opening in a new window cos I carnt just press the back button.

There is no excuse for it all links should always open in the same window thats why target="_blank" is not classed as correct coding.This is another one of them topics just not even worth going over though really its upto you wether you want to stick with the standards or not.

Its always the same whenever it comes to doing anything the proper or new way people disagree and say but I dont like it, just like the tables and divs argument, just like the argument of wether standards are worth sticking to or not. Thing is its upto you what you want to do we were simpley explaining why its is the way it is, personally I like the idea but then others dont understand why, thats cool were all different and have different opinions.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

Last edited by johneva; 12-23-2007 at 12:23 PM..
johneva is offline
Reply With Quote
View Public Profile Visit johneva's homepage!
 
Old 12-23-2007, 03:13 PM Re: target="_blank"
joder's Avatar
Flipotron

Posts: 6,442
Name: James
Location: In the ocean.
Trades: 0
Everyone has a right to their opinion. I happen to agree with Strict not using target. If you want to use Strict and target, your site will not be compliant. You will have to use javascript to open a new window. But if someone wants to complain about the standard, this is not the place to do it. It would be better to do than on the W3C site.
joder is offline
Reply With Quote
View Public Profile
 
Old 12-23-2007, 06:05 PM Re: target="_blank"
Truly's Avatar
Ultra Talker

Posts: 322
Trades: 0
Im not complaining just curious. Thanks for the lesson
Truly is offline
Reply With Quote
View Public Profile
 
Old 12-24-2007, 11:05 AM Re: target="_blank"
Junior Talker

Posts: 3
Name: Kevin
Trades: 0
Quote:
Originally Posted by LadynRed View Post
Joder is exactly right, it is not valid for a Strict doctype. The question becomes - why are you opening up a new window anyway ?
I think the question actually becomes: Why are you insisting on strict? Are you comfortable using transitional instead? That would allow the target attribute to validate while still avoiding javascript. Either way, you're losing one of the two things you were asking about: either no strict, or yes javascript.
zimdanen is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to target="_blank"

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.14944 seconds with 12 queries