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 03-14-2005, 11:31 PM target=_blank
Novice Talker

Posts: 9
Trades: 0
I just ran my website through the validator, and it gave me this:

Code:
Line 66, column 54: there is no attribute "TARGET"

...end a <a href="images/teddy/" target=_blank>teddy bear</a> for valentines day

You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.
How are you supposed to open a link in a new window without using 'target'? Or should you not use "strict" if you want to do that? (I don't really understand why you would use strict if there is no alternative)
__________________
http://duffx.com
Duffx is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-15-2005, 12:26 AM
Skilled Talker

Posts: 97
Trades: 0
use a javascript popup function.
__________________

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
daboss is offline
Reply With Quote
View Public Profile Visit daboss's homepage!
 
Old 03-15-2005, 03:12 AM
Gaffer Sports's Avatar
Ultra Talker

Posts: 397
Name: Steve
Location: Scotland
Trades: 1
Try:

target="_blank"
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
Gaffer Sports is offline
Reply With Quote
View Public Profile Visit Gaffer Sports's homepage!
 
Old 03-15-2005, 09:58 AM
Novice Talker

Posts: 6
Location: Trapped in the hills of upstate New York
Trades: 0
Also try it without the _ like this: target="blank" it works for me
__________________
Thom M

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


Please login or register to view this content. Registration is FREE
Thom M is offline
Reply With Quote
View Public Profile Visit Thom M's homepage!
 
Old 03-15-2005, 10:56 AM
Novice Talker

Posts: 9
Trades: 0
The link works fine, it's just that the validator doesn't like "target".

http://validator.w3.org/
__________________
http://duffx.com
Duffx is offline
Reply With Quote
View Public Profile
 
Old 03-15-2005, 11:09 AM
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
What DOCTYPE are you using?
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 03-15-2005, 12:13 PM
Novice Talker

Posts: 9
Trades: 0
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

I ended up creating a javascript function as follows:

Code:
function aclick(url){
	window.open(url,'duffx','width=775,height=450,resizable,scrollbars,toolbar,location,menubar,status'); 
}
And I call it by doing

Code:
<a href="images/teddy/" onClick="aclick(this.href); return false;">teddy bear</a>
It passes validation, and this way it's more obvious that I opened a popup because of the smaller size, instead of it opening full-screen. (When I've seen the older generation like my mother browse my website, she always looks for a back button on pages I had open in a new window). If someone has javascript disabled, it just opens the link in the current window.

For those interested, the code

Code:
<a href="images/teddy/" onClick="window.open(this.href); return false;">teddy bear</a>
will do the EXACT same thing as

Code:
<a href="images/teddy/" target=_blank>teddy bear</a>
and still pass strict validation (if anyone cares).
__________________
http://duffx.com
Duffx is offline
Reply With Quote
View Public Profile
 
Old 03-15-2005, 08:20 PM
Extreme Talker

Posts: 170
Location: Canada
Trades: 0
The only problem is that you left out the quotes, the link will work just fine in the form target="_blank" as some of the others have said. The problem is not a complex one.
collyer_1 is offline
Reply With Quote
View Public Profile Visit collyer_1's homepage!
 
Old 03-18-2005, 04:31 PM
Junior Talker

Posts: 2
Trades: 0
Here is a XHTML 1.0 Strict way of using the target="_blank" function.

<a href="" onclick="window.open('http://yourlink.com/'); return false">
Raptre is offline
Reply With Quote
View Public Profile
 
Old 03-19-2005, 03:07 PM
Novice Talker

Posts: 9
Trades: 0
Quote:
Originally Posted by collyer_1
The only problem is that you left out the quotes, the link will work just fine in the form target="_blank" as some of the others have said. The problem is not a complex one.
Did you care to read my last post? Again, the link works fine, but the code does not pass strict validation. However, I ended up using the javascript I posted above.
__________________
http://duffx.com
Duffx is offline
Reply With Quote
View Public Profile
 
Old 03-20-2005, 03:23 PM
Extreme Talker

Posts: 160
Trades: 0
"target" is not part of HTML strict (or xhtml strict ) and so was correctly invalidated.

Your solution is ideal if you want to avoid transitional as it allows for non-scripting and pop-up blocking / JavaScript disabled browsers.
ElectricSheep 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 0.40830 seconds with 12 queries