Validating target

This is a discussion on "Validating target" within the Web Page Design section. This forum, and the thread "Validating target are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 13th, 2007, 19:32
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Cool Validating target

HI;
I'm struggling with this very basic element. Can anyone help me?
I'm using this code but it's not validating for XHTML 1.0 strict
Code: Select all
Website by<a href="http://www.maine-lyweb.com" target="new"> Maine-ly Web Design</a>
The error message is
Quote:
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.
Thanks in advance!

Last edited by Lchad; Jan 13th, 2007 at 19:32. Reason: typo
Reply With Quote

  #2 (permalink)  
Old Jan 13th, 2007, 19:38
Reputable Member
Join Date: Dec 2005
Location: Bristol
Posts: 268
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to crewdesign
Re: Validating target

I dont think you can use target attributes in xhtml. You would have to use javascript instead
Reply With Quote
  #3 (permalink)  
Old Jan 13th, 2007, 20:04
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Validating target

Thanks crewdesign... your answer was just enough to get me going in the right direction.
I did a google search and came up with this article/tut if anyone is interested!
You are right, Javascript is an option...
Thanks
Reply With Quote
  #4 (permalink)  
Old Jan 13th, 2007, 20:49
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Validating target

Here more info for you

Using JavaScript instead of target to open new windows

And make sure you scroll to the bottom where it says "Possibly related posts"
Reply With Quote
  #5 (permalink)  
Old Jan 14th, 2007, 02:08
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Validating target

Just thought I'd comment on these because I looked at both of the scripts. Lchad, the article you linked to is strange... It's basically using JavaScript to sidestep XHTML validation. It's tricking validators into thinking that there is no target attribute anywhere, when in reality, JS is placing them behind their backs.

Karinne's link provides a rather bloated script. I prefer this:

Code: Select all
var Popups = {
	init: function() {
		if(!document.getElementsByTagName) {
			return false;
		}
		var links = document.getElementsByTagName("a");
		for(var i=0; i < links.length; i++) {
			if(links[i].className.match("popup")) {
				links[i].onclick = Popups.handle;
			}
		}
	},
	handle: function() {
		window.open(this.href);
		return false;
	}
}
window.onload = Popups.init;
Just add class="popup" to any link and it'll open in a new window.
Reply With Quote
  #6 (permalink)  
Old Jan 14th, 2007, 13:25
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Validating target

Lets not forget that however you achieve it, a pop-up is still a pop-up and more and more people block them thanks to their constant abuse.

I strongly suggest that you rethink whether or not there is an alternative approach.

A lot of people have used them on external links because they do not want the user to move away from their web site, but if the web site is good enough, they will come back.

Also, consider the confusion it can cause for some people.

Accessibility!!!
Reply With Quote
  #7 (permalink)  
Old Jan 14th, 2007, 14:16
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Validating target

Well then what is a happy medium. There are instances where you need to offer a link to an outside source. What do you suggest?
Reply With Quote
  #8 (permalink)  
Old Jan 14th, 2007, 17:30
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Validating target

Just have your link to an outside source.

In the title attribute you can make reference to the fact that this is an external link along with other useful information.

People will come back to your site if they want to. Don't force them to stay there.
Reply With Quote
  #9 (permalink)  
Old Jan 15th, 2007, 00:39
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Validating target

I really don't like popups at all, either. I have several links to outside sources on my website and they don't open in popups. I figure they will either come back, or open the site in a new window/tab by themselves.
Reply With Quote
  #10 (permalink)  
Old Jan 15th, 2007, 12:33
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Validating target

Well I see your point. This is going to be a hard adjustment for me.

Does CSS3 have a target worked into it's code for the future?
Reply With Quote
  #11 (permalink)  
Old Jan 15th, 2007, 15:45
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Validating target

I wouldn't expect it to because you are talking about an 'operational' attribute
and not a 'styling' attribute.
Reply With Quote
  #12 (permalink)  
Old Jan 15th, 2007, 20:32
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Validating target

JavaScript is the only true behavioral part of a website, so it and pop ups go hand in hand.

Last edited by moojoo; Jan 16th, 2007 at 15:37.
Reply With Quote
  #13 (permalink)  
Old Jan 16th, 2007, 15:37
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,608
Thanks: 0
Thanked 6 Times in 6 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: Validating target

I always have new windows etc open in tabs, so nomatter what you do I get a full size window with the content =P.
__________________
I've got <style> and .class
Reply With Quote
  #14 (permalink)  
Old Jan 16th, 2007, 19:53
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Validating target

moojoo what code do you use to open in new tabs?
Reply With Quote
  #15 (permalink)  
Old Jan 16th, 2007, 19:56
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: Validating target

I believe moojoo is referring to firefox, which is a tabbed browser....download it, it is free, fast, and cool...lol
Reply With Quote
  #16 (permalink)  
Old Jan 16th, 2007, 20:01
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Validating target

oh... I see.. misunderstood... I have ff... LOL
Reply With Quote
  #17 (permalink)  
Old Jan 18th, 2007, 13:36
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,608
Thanks: 0
Thanked 6 Times in 6 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: Validating target

Safari and FF I have the prefs set to always open links etc in new tabs not windows.
__________________
I've got <style> and .class
Reply With Quote
Reply

Tags
html validator, link target

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Target _blank Jack Franklin Web Page Design 12 Oct 12th, 2007 09:55
Target Window Name jayaramgussy Web Page Design 9 Sep 20th, 2007 22:44
XHTML Target JacobHaug Web Page Design 7 Jan 4th, 2007 11:55
Save Target As VanderBOOM JavaScript Forum 4 Dec 15th, 2005 10:25
Frameset target help please charter Flash & Multimedia Forum 4 Mar 28th, 2004 10:05


All times are GMT. The time now is 22:16.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43