
July 20th, 2005, 06:46 PM
| | | No target attribute in the A element (XHTML 1.0)
When using the XHTML 1.0 validator at http://validator.w3.org/check, an
error will be raised for every instance of a "target" attribute in "A"
elements. Is it truely because it is not part of this specification
anymore, or is it an error in the SGML parser ? Any alternatives ?
html code :
<a href="./page.html" class="pagelink" target="_self">some text</a>
used doctype :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Result received :
This page is not Valid XHTML 1.0 Strict!
Line 66, column 66: there is no attribute "target" (explain...).
<a href="./page.html" class="pagelink" target="_self">some text</a>
Mark van Ballegooijen | 
July 20th, 2005, 06:46 PM
| | | Re: No target attribute in the A element (XHTML 1.0)
Mark van Ballegooijen wrote:
[color=blue]
> When using the XHTML 1.0 validator at http://validator.w3.org/check, an
> error will be raised for every instance of a "target" attribute in "A"
> elements. Is it truely because it is not part of this specification
> anymore, or is it an error in the SGML parser ? Any alternatives ?
>
> html code :
>
> <a href="./page.html" class="pagelink" target="_self">some text</a>
>
> used doctype :
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
> Result received :
>
> This page is not Valid XHTML 1.0 Strict!
> Line 66, column 66: there is no attribute "target" (explain...).
> <a href="./page.html" class="pagelink" target="_self">some text</a>[/color]
Are you trying to use frames?
I guess not, so, why are you using target? Without a target,
any link will open in the same window, which you seem to
want, using "_self"...
As far as I know, the target attribute isn't part of XHTML,
and was only intended to be used within a frameset.
It's not part of HTML 4.01 Strict either.
--
Els
Mente humana é como pára-quedas; funciona melhor aberta. | 
July 20th, 2005, 06:46 PM
| | | Re: No target attribute in the A element (XHTML 1.0)
Els wrote:
[color=blue]
> Mark van Ballegooijen wrote:
>[color=green]
>> When using the XHTML 1.0 validator at http://validator.w3.org/check,
>> an error will be raised for every instance of a "target" attribute in
>> "A" elements. Is it truely because it is not part of this
>> specification anymore, or is it an error in the SGML parser ? Any
>> alternatives ?
>>
>> html code :
>>
>> <a href="./page.html" class="pagelink" target="_self">some text</a>
>>
>> used doctype :
>>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>>
>> Result received :
>>
>> This page is not Valid XHTML 1.0 Strict!
>> Line 66, column 66: there is no attribute "target" (explain...).
>> <a href="./page.html" class="pagelink" target="_self">some text</a>[/color]
>
>
> Are you trying to use frames?
> I guess not, so, why are you using target? Without a target, any link
> will open in the same window, which you seem to want, using "_self"...
>
> As far as I know, the target attribute isn't part of XHTML, and was only
> intended to be used within a frameset.
> It's not part of HTML 4.01 Strict either.
>[/color]
No, I'm not using frames.
You're right about the window though, _self is the current one so it's
actually quite useless. The reason i use it is that i would like links
to pages on my own website/server to be opened in the current window
(_self), and external links in a new window (_blank). If this
attribute is indeed deprecated, which seems to be the case, is there an
alternative to target="_blank" to open hyperlinks in a new/blank window ?
Mark van Ballegooijen | 
July 20th, 2005, 06:46 PM
| | | Re: No target attribute in the A element (XHTML 1.0)
On Fri, 20 Feb 2004, Mark van Ballegooijen wrote:
[color=blue]
> When using the XHTML 1.0 validator at http://validator.w3.org/check, an
> error will be raised for every instance of a "target" attribute in "A"
> elements. Is it truely because it is not part of this specification
> anymore, or is it an error in the SGML parser ? Any alternatives ?[/color]
Avoid frames like the plague! | 
July 20th, 2005, 06:46 PM
| | | Re: No target attribute in the A element (XHTML 1.0)
Mark van Ballegooijen wrote:
[color=blue]
> You're right about the window though, _self is the current one so it's
> actually quite useless. The reason i use it is that i would like links
> to pages on my own website/server to be opened in the current window
> (_self), and external links in a new window (_blank). If this
> attribute is indeed deprecated, which seems to be the case, is there an
> alternative to target="_blank" to open hyperlinks in a new/blank window ?[/color]
Not that I know of, other than using javascript.
I have the same idea as you about external links opening in
a new window, that's why I use HTML 4.01 Transitional on
pages with external links, and not Strict or XHTML.
A lot of people (on usenet in web-related groups) have the
opinion though, that a link should always open in the same
window, because the user is able to right click a link if he
wants it in a new window (or tab).
--
Els
Mente humana é como pára-quedas; funciona melhor aberta. | 
July 20th, 2005, 06:46 PM
| | | Re: No target attribute in the A element (XHTML 1.0)
Els wrote:[color=blue]
> Mark van Ballegooijen wrote:
>[color=green]
>> You're right about the window though, _self is the current one so it's
>> actually quite useless. The reason i use it is that i would like links
>> to pages on my own website/server to be opened in the current window
>> (_self), and external links in a new window (_blank). If this
>> attribute is indeed deprecated, which seems to be the case, is there
>> an alternative to target="_blank" to open hyperlinks in a new/blank
>> window ?[/color]
>
>
> Not that I know of, other than using javascript.
> I have the same idea as you about external links opening in a new
> window, that's why I use HTML 4.01 Transitional on pages with external
> links, and not Strict or XHTML.
>
> A lot of people (on usenet in web-related groups) have the opinion
> though, that a link should always open in the same window, because the
> user is able to right click a link if he wants it in a new window (or tab).
>[/color]
So it seems.
i'll just use the current window for all links, and leave the target
attribute out then (i'm not a real javascript supporter for these kind
of things).
Anyway, thanks a lot for the quick replies !
Mark van Ballegooijen | 
July 20th, 2005, 06:46 PM
| | | Re: No target attribute in the A element (XHTML 1.0)
Mark van Ballegooijen <mvballegooijen@xs4all.nl> wrote:
[color=blue]
>When using the XHTML 1.0 validator at http://validator.w3.org/check, an
>error will be raised for every instance of a "target" attribute in "A"
>elements. Is it truely because it is not part of this specification
>anymore, or is it an error in the SGML parser ? Any alternatives ?[/color]
The target attribute has not been part of the Strict (X)HTML
specifications since 1997. It has only ever been part of the
Transitional specifications. This is the same for HTMl 4.0, HTML 4.01
and XHTML 1.0.
There are two reasons to use target : frames and new windows.
Neither frames nor the forced opening of new windows are in the spirit
of the Strict versions of (X)HTML. So either don't use them, or use a
Transitional version instead.
Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor
Steve Pugh <steve@pugh.net> <http://steve.pugh.net/> | 
July 20th, 2005, 06:46 PM
| | | Re: No target attribute in the A element (XHTML 1.0)
On Fri, 20 Feb 2004, Steve Pugh wrote:
[color=blue]
> There are two reasons to use target : frames and new windows.[/color]
And a third - to try to avoid getting one's own page framed by someone
else.
But I'm afraid that baby has to get thrown out with the bathwater, if
one's aim is to get validated against the strict DTD. | 
July 20th, 2005, 06:46 PM
| | | Re: No target attribute in the A element (XHTML 1.0)
Steve Pugh wrote:[color=blue][color=green]
>> There are two reasons to use target : frames and new windows.[/color][/color]
Alan J. Flavell <flavell@ph.gla.ac.uk> wrote:[color=blue]
> And a third - to try to avoid getting one's own page framed by someone
> else.
>
> But I'm afraid that baby has to get thrown out with the bathwater, if
> one's aim is to get validated against the strict DTD.[/color]
Yep.
I created a custom DTD that is essentially a copy of the Strict DTD, with
target="_top" allowed, and a couple things that I want to avoid (like <q>)
removed. I validate against my (almost Strict) custom DTD, and then
advertise the documents to be Transitional (which they are).
--
Darin McGrew, mcgrew@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, darin@htmlhelp.com, http://www.HTMLHelp.com/
"The early bird gets the worm, but the second mouse gets the cheese." | 
July 20th, 2005, 06:46 PM
| | | Re: No target attribute in the A element (XHTML 1.0)
"Alan J. Flavell" <flavell@ph.gla.ac.uk> wrote:
[color=blue]
>On Fri, 20 Feb 2004, Steve Pugh wrote:
>[color=green]
>> There are two reasons to use target : frames and new windows.[/color]
>
>And a third - to try to avoid getting one's own page framed by someone
>else.[/color]
I was including that in the general category of 'frames'.
[color=blue]
>But I'm afraid that baby has to get thrown out with the bathwater, if
>one's aim is to get validated against the strict DTD.[/color]
Though I'm sure we agree that that's an odd aim to have. Validation is
means to an end not an end in itself.
Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor
Steve Pugh <steve@pugh.net> <http://steve.pugh.net/> | 
July 20th, 2005, 06:46 PM
| | | Re: No target attribute in the A element (XHTML 1.0)
On Fri, 20 Feb 2004 18:21:14 +0100, Els <els.aNOSPAM@tiscali.nl> wrote:
[color=blue]
> A lot of people (on usenet in web-related groups) have the opinion
> though, that a link should always open in the same window, because the
> user is able to right click a link if he wants it in a new window (or
> tab).
>[/color]
On an external links page, I'm likely to recommend right-clicking and
opening the link in a new window. But yes, it's not polite to force a new
window, especially since more and more people are blocking popups and
there's a good chance the link will fail if you try it. | 
July 20th, 2005, 06:46 PM
| | | Re: No target attribute in the A element (XHTML 1.0)
Neal <neal413@spamrcn.com> wrote:
[color=blue]
>But yes, it's not polite to force a new
>window, especially since more and more people are blocking popups and
>there's a good chance the link will fail if you try it.[/color]
New window != Popup.
A UA configured not to allow new windows will open the link in the
existing window (no failure).
--
Spartanicus | 
July 20th, 2005, 06:46 PM
| | | Re: No target attribute in the A element (XHTML 1.0)
On Fri, 20 Feb 2004 21:35:00 +0000, Spartanicus <me@privacy.net> wrote:
[color=blue]
> Neal <neal413@spamrcn.com> wrote:
>[color=green]
>> But yes, it's not polite to force a new
>> window, especially since more and more people are blocking popups and
>> there's a good chance the link will fail if you try it.[/color]
>
> New window != Popup.
>
> A UA configured not to allow new windows will open the link in the
> existing window (no failure).
>[/color]
Not in each case. I used a popup blocker briefly which required me to
Control-click to override the block. If I did not, it didn't open it at
all. Wish I remembered the name of the software, but it was some time ago.
Still, never safe to assume, always better to code as fool-proof as
possible. | 
July 20th, 2005, 06:46 PM
| | | Re: No target attribute in the A element (XHTML 1.0)
Neal <neal413@spamrcn.com> wrote:
[color=blue][color=green]
>> A UA configured not to allow new windows will open the link in the
>> existing window (no failure).[/color]
>
>Not in each case. I used a popup blocker briefly which required me to
>Control-click to override the block.[/color]
Again: New window != Popup.
--
Spartanicus | 
July 20th, 2005, 06:46 PM
| | | Re: No target attribute in the A element (XHTML 1.0)
In article
<2a0d309t1po7j96up85f2vpggd81li847i@news.spartanic us.utvinternet.ie>,
Spartanicus <me@privacy.net> wrote:
[color=blue]
> Neal <neal413@spamrcn.com> wrote:
>[color=green][color=darkred]
> >> A UA configured not to allow new windows will open the link in the
> >> existing window (no failure).[/color]
> >
> >Not in each case. I used a popup blocker briefly which required me to
> >Control-click to override the block.[/color]
>
> Again: New window != Popup.[/color]
Some pop-up blockers seem to disagree, however.
--
| Andrew Glasgow <amg39(at)cornell.edu> |
| "Provide me with ships or proper sails for the celestial atmosphere and |
| there will be men there, too, who do not fear the appalling distance" |
| -- Johannes Kepler | | 
July 20th, 2005, 06:47 PM
| | | Re: No target attribute in the A element (XHTML 1.0)
On Fri, 20 Feb 2004 21:52:43 +0000, Spartanicus <me@privacy.net> wrote:
[color=blue]
> Neal <neal413@spamrcn.com> wrote:
>[color=green][color=darkred]
>>> A UA configured not to allow new windows will open the link in the
>>> existing window (no failure).[/color]
>>
>> Not in each case. I used a popup blocker briefly which required me to
>> Control-click to override the block.[/color]
>
> Again: New window != Popup.
>[/color]
I have no idea what you mean with the !, it sure as hell ain't HTML. I
can't tell if you're agreeing with me or arguing with me. | 
July 20th, 2005, 06:47 PM
| | | Re: No target attribute in the A element (XHTML 1.0)
Spartanicus <me@privacy.net> wrote:[color=blue][color=green]
>> Again: New window != Popup.[/color][/color]
Like beauty, this is in the eye of the beholder.
For example, Opera makes a distinction between requested pop-up windows and
unrequested pop-up windows. I think you're using the terms "new window" and
"popup" to make this same distinction.
I'm not sure what I find more annoying: links that open new windows when I
don't want them, or links that try to open new windows when I do want them,
but which then don't work at all because the JavaScript gets confused by
the new windows that I've opened.
Neal <neal413@spamrcn.com> wrote:[color=blue]
> I have no idea what you mean with the !, it sure as hell ain't HTML. I
> can't tell if you're agreeing with me or arguing with me.[/color]
Many programming languages use ! for logical negation, != for "not equal
to", and so on. Spartanicus is simply asserting that new windows are not
necessarily pop-up windows.
--
Darin McGrew, mcgrew@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, darin@htmlhelp.com, http://www.HTMLHelp.com/
"Mistakes are the portals of discovery." - James Joyce |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over network members.
|