HighDots Forums  

xhtml target attribute question

Websites/HTML pages critique & reviews Discuss and review existing WWW material (alt.html.critique)


Discuss xhtml target attribute question in the Websites/HTML pages critique & reviews forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
lamp
 
Posts: n/a

Default xhtml target attribute question - 07-23-2006 , 02:33 AM






I am not sure where to post my question. I hope somebody in this
newsgroup could answer my question.

I would like to use xhtml strict, so I am converting my html
transitional to strict. I ran into a problem using <a> tag with a target
attribute, like this:

<a href="my.html" target="-blank">My Site in new window</a>

When I submitted the html file for validation, it complained that the
attribute target is not acceptable in strict. (Only in transitional)

My question therefore is: How do I do this in strict version? Or can I
do it?

Thank you.




Reply With Quote
  #2  
Old   
Els
 
Posts: n/a

Default Re: xhtml target attribute question - 07-23-2006 , 04:21 AM






lamp wrote:

[target attribute not available in Strict]
Quote:
My question therefore is: How do I do this in strict version? Or can I
do it?
No, you just don't :-)
If people want a new window to open, they can do that themselves.

There is a lot of discussion about this on the web, so if you're
interested in the pros and cons, just Google.

If after you've read enough you still want to open new windows
regardless of what the visitor wants, then there's 3 choices:

- live with invalid code
- go back to Transitional
- use JavaScript instead

--
Els http://locusmeus.com/


Reply With Quote
  #3  
Old   
Ed Seedhouse
 
Posts: n/a

Default Re: xhtml target attribute question - 07-23-2006 , 02:51 PM



On Sun, 23 Jul 2006 06:33:28 GMT, "lamp" <a8a16803 (AT) telus (DOT) net> wrote:


Quote:
a href="my.html" target="-blank">My Site in new window</a

When I submitted the html file for validation, it complained that the
attribute target is not acceptable in strict. (Only in transitional)

My question therefore is: How do I do this in strict version? Or can I
do it?
You don't. And you shouldn't. It reduces the useability of your page
by breaking the user's expecations.



Reply With Quote
  #4  
Old   
Louis
 
Posts: n/a

Default Re: xhtml target attribute question - 07-24-2006 , 10:57 AM



Els wrote:
Quote:
lamp wrote:

[target attribute not available in Strict]
My question therefore is: How do I do this in strict version? Or can I
do it?

No, you just don't :-)
If people want a new window to open, they can do that themselves.

There is a lot of discussion about this on the web, so if you're
interested in the pros and cons, just Google.

If after you've read enough you still want to open new windows
regardless of what the visitor wants, then there's 3 choices:

- live with invalid code
- go back to Transitional
- use JavaScript instead

Thanks Els,

Those are good options offered. Appreciate it.


Reply With Quote
  #5  
Old   
granpaw
 
Posts: n/a

Default Re: xhtml target attribute question - 09-18-2006 , 11:35 PM



"lamp" <a8a16803 (AT) telus (DOT) net> wrote in news:YKEwg.160151$771.22987@edtnps89:

Quote:
I am not sure where to post my question. I hope somebody in this
newsgroup could answer my question.

I would like to use xhtml strict, so I am converting my html
transitional to strict. I ran into a problem using <a> tag with a target
attribute, like this:

a href="my.html" target="-blank">My Site in new window</a

When I submitted the html file for validation, it complained that the
attribute target is not acceptable in strict. (Only in transitional)

My question therefore is: How do I do this in strict version? Or can I
do it?

Thank you.



Hmmm just a wild guess but my thinking is that you need an underscore (_)
instead of a dash(-) in front of blank...that is if you want the link to
open in another window, which as the rest have said is really not a good
idea and I agree with the rest on that point.

granpaw


Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.