Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

HTML - XHTML Strict - using target inside <a>

 
Thread Tools Search this Thread
Old 04-07-2004, 03:42 PM   #1
Default XHTML Strict - using target inside <a>


Hi all,

I'm just starting out to convert my web site to XHTML.

I use:

<a href="website.html" target="_blank">Test</a>

I use that a lot - and I was shocked to see when I validated my web
site against the Strict DTD it said that the target tribute was invalid.

I understand that it can be used with regards to frames, but not with
opening links in new windows.

Is there something I should be using instead?

Really appreciate any help that can be given.

Thanks.

Dave.



Dave Winter
  Reply With Quote
Old 04-07-2004, 03:54 PM   #2
brucie
 
Posts: n/a
Default Re: XHTML Strict - using target inside <a>

in post: <news:2004040715424616807%davewinter@maccom>
Dave Winter <> said:

> I'm just starting out to convert my web site to XHTML.


why?

> <a href="website.html" target="_blank">Test</a>
> I use that a lot


if your visitors want a new window/tab they can do it themselves.

> and I was shocked to see when I validated my web site against the
> Strict DTD it said that the target tribute was invalid.


correct

> Is there something I should be using instead?


1. ignore the error
2. modify the DTD
3. change the DTD
4. scripting (not recommended)
5. let your visitors open new windows/tabs (recommended)

--
b r u c i e
  Reply With Quote
Old 04-07-2004, 04:01 PM   #3
Steve Pugh
 
Posts: n/a
Default Re: XHTML Strict - using target inside <a>

Dave Winter <> wrote:

>I'm just starting out to convert my web site to XHTML.


Any particular reason?

><a href="website.html" target="_blank">Test</a>
>
>I use that a lot - and I was shocked to see when I validated my web
>site against the Strict DTD it said that the target tribute was invalid.


This has been the case since HTML 4 was released in 1997. So I guess
that you're jumping straight from HTML 4 Transitional to XHTML 1
Strict.

>I understand that it can be used with regards to frames, but not with
>opening links in new windows.


Frames, windows, same thing - they're media specific and nothing to do
with marking up data, which is what the Strict versions of HTML 4 and
XHTML 1 are all about.

>Is there something I should be using instead?


1. Don't try to force new windows on your users, let them choose when
to open a link in a new window or tab.
2. Use a Transitional version instead.
3. Use JavaScript, but be sure to write it in such a way that the link
still works when JS isn't enabled.
4. Ignore validation. Valid code is good but it is only a means to an
end not a goal in itself.

Why do you want you code to validate as XHTML 1.0 Strict?

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <> <http://steve.pugh.net/>
  Reply With Quote
Old 04-07-2004, 04:18 PM   #4
Joshua Beall
 
Posts: n/a
Default Re: XHTML Strict - using target inside <a>

"Steve Pugh" <> wrote in message
news:...
> ><a href="website.html" target="_blank">Test</a>
> >
> >I use that a lot - and I was shocked to see when I validated my web
> >site against the Strict DTD it said that the target tribute was invalid.

>
> This has been the case since HTML 4 was released in 1997. So I guess
> that you're jumping straight from HTML 4 Transitional to XHTML 1
> Strict.


Do I correctly interpret this as meaning that there is no valid way to cause
a link to open in a new browser, unless you are using HTML4 Transitional?

Aside from JS solutions. I try to avoid JS when possible though.


  Reply With Quote
Old 04-07-2004, 04:31 PM   #5
Steve Pugh
 
Posts: n/a
Default Re: XHTML Strict - using target inside <a>

"Joshua Beall" <> wrote:

>"Steve Pugh" <> wrote in message
>news:.. .
>> ><a href="website.html" target="_blank">Test</a>
>> >
>> >I use that a lot - and I was shocked to see when I validated my web
>> >site against the Strict DTD it said that the target tribute was invalid.

>>
>> This has been the case since HTML 4 was released in 1997. So I guess
>> that you're jumping straight from HTML 4 Transitional to XHTML 1
>> Strict.

>
>Do I correctly interpret this as meaning that there is no valid way to cause
>a link to open in a new browser, unless you are using HTML4 Transitional?


No, you can use XHTML 1.0 Transitional.

Steve



--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <> <http://steve.pugh.net/>
  Reply With Quote
Old 04-07-2004, 04:32 PM   #6
David Håsäther
 
Posts: n/a
Default Re: XHTML Strict - using target inside <a>

Joshua Beall <> wrote:

> "Steve Pugh" <> wrote in message
> news:...
>> ><a href="website.html" target="_blank">Test</a>
>> >
>> >I use that a lot - and I was shocked to see when I validated my
>> >web site against the Strict DTD it said that the target tribute
>> >was invalid.

>>
>> This has been the case since HTML 4 was released in 1997. So I
>> guess that you're jumping straight from HTML 4 Transitional to
>> XHTML 1 Strict.

>
> Do I correctly interpret this as meaning that there is no valid
> way to cause a link to open in a new browser, unless you are using
> HTML4 Transitional?


You could use any DTD that has the target attribute in it.

--
David Håsäther
  Reply With Quote
Old 04-07-2004, 04:47 PM   #7
Dave Winter
 
Posts: n/a
Default Re: XHTML Strict - using target inside <a>

On 2004-04-07 16:01:26 +0100, Steve Pugh <> said:

> Dave Winter <> wrote:
>
>> I'm just starting out to convert my web site to XHTML.

>
> Any particular reason?
>> <a href="website.html" target="_blank">Test</a>
>>
>> I use that a lot - and I was shocked to see when I validated my web
>> site against the Strict DTD it said that the target tribute was invalid.

>
> This has been the case since HTML 4 was released in 1997. So I guess
> that you're jumping straight from HTML 4 Transitional to XHTML 1
> Strict.
>> I understand that it can be used with regards to frames, but not with
>> opening links in new windows.

>
> Frames, windows, same thing - they're media specific and nothing to do
> with marking up data, which is what the Strict versions of HTML 4 and
> XHTML 1 are all about.
>
>> Is there something I should be using instead?

>
> 1. Don't try to force new windows on your users, let them choose when
> to open a link in a new window or tab.
> 2. Use a Transitional version instead.
> 3. Use JavaScript, but be sure to write it in such a way that the link
> still works when JS isn't enabled.
> 4. Ignore validation. Valid code is good but it is only a means to an
> end not a goal in itself.
>
> Why do you want you code to validate as XHTML 1.0 Strict?
> Steve


There's no real reason why, I'm just looking into how easy it would be
to convert it to XHTML.

From what I've seen of XHTML code, it's so much tidier. This is
probably the main reason for me.

And I like the point you make about not forcing new windows to open.

I'll make a new post in a few minutes asking about converting my site
from <table> to <div>

  Reply With Quote
Old 04-07-2004, 04:53 PM   #8
Joshua Beall
 
Posts: n/a
Default Re: XHTML Strict - using target inside <a>

"Steve Pugh" <> wrote in message
news:...
> >Do I correctly interpret this as meaning that there is no valid way to

cause
> >a link to open in a new browser, unless you are using HTML4 Transitional?

>
> No, you can use XHTML 1.0 Transitional.


Oops, phrased my question wrong: there is no valid to cause a link to open
in a new browser, if you are using an XHTML1.0/1.1 Strict doctype?


  Reply With Quote
Old 04-07-2004, 06:22 PM   #9
David Dorward
 
Posts: n/a
Default Re: XHTML Strict - using target inside <a>

Joshua Beall wrote:

> Oops, phrased my question wrong: there is no valid to cause a link to open
> in a new browser, if you are using an XHTML1.0/1.1 Strict doctype?


XHTML 1.0 Strict - no
XHTML 1.1 - no
XHTML 1.1 Strict - no such thing
XHTML 1.1 with a frames module of some description[1] - yes

[1] I'm being vague here because I haven't been inclined to use any modules
with XHTML 1.1 so its somewhat outside my experience.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
  Reply With Quote
Old 04-07-2004, 08:35 PM   #10
Brendan Taylor
 
Posts: n/a
Default Re: XHTML Strict - using target inside <a>

On Thu, 08 Apr 2004 00:54:49 +1000, brucie wrote:

> in post: <news:2004040715424616807%davewinter@maccom>
> Dave Winter <> said:
>
>> I'm just starting out to convert my web site to XHTML.

>
> why?


Why not?
  Reply With Quote
Reply


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

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