|
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 | |
Share:
|
Mark van Ballegooijen wrote: 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>
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. | | |
Els wrote: Mark van Ballegooijen wrote:
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>
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.
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 | | |
On Fri, 20 Feb 2004, Mark van Ballegooijen wrote: 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 ?
Avoid frames like the plague! | | |
Mark van Ballegooijen wrote: 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 ?
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. | | |
Els wrote: Mark van Ballegooijen wrote:
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 ?
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).
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 | | |
Mark van Ballegooijen <mv************@xs4all.nl> wrote: 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 ?
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 <st***@pugh.net> <http://steve.pugh.net/> | | |
On Fri, 20 Feb 2004, Steve Pugh wrote: There are two reasons to use target : frames and new windows.
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. | | |
Steve Pugh wrote: There are two reasons to use target : frames and new windows.
Alan J. Flavell <fl*****@ph.gla.ac.uk> wrote: 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.
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, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/
"The early bird gets the worm, but the second mouse gets the cheese." | | |
"Alan J. Flavell" <fl*****@ph.gla.ac.uk> wrote: On Fri, 20 Feb 2004, Steve Pugh wrote:
There are two reasons to use target : frames and new windows. And a third - to try to avoid getting one's own page framed by someone else.
I was including that in the general category of 'frames'.
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.
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 <st***@pugh.net> <http://steve.pugh.net/> | | |
On Fri, 20 Feb 2004 18:21:14 +0100, Els <el*********@tiscali.nl> wrote: 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).
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. | | |
Neal <ne*****@spamrcn.com> wrote: 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.
New window != Popup.
A UA configured not to allow new windows will open the link in the
existing window (no failure).
--
Spartanicus | | |
On Fri, 20 Feb 2004 21:35:00 +0000, Spartanicus <me@privacy.net> wrote: Neal <ne*****@spamrcn.com> wrote:
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.
New window != Popup.
A UA configured not to allow new windows will open the link in the existing window (no failure).
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. | | |
Neal <ne*****@spamrcn.com> wrote: A UA configured not to allow new windows will open the link in the existing window (no failure).
Not in each case. I used a popup blocker briefly which required me to Control-click to override the block.
Again: New window != Popup.
--
Spartanicus | | |
In article
<2a********************************@news.spartanic us.utvinternet.ie>,
Spartanicus <me@privacy.net> wrote: Neal <ne*****@spamrcn.com> wrote:
A UA configured not to allow new windows will open the link in the existing window (no failure).
Not in each case. I used a popup blocker briefly which required me to Control-click to override the block.
Again: New window != Popup.
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 | | | |
On Fri, 20 Feb 2004 21:52:43 +0000, Spartanicus <me@privacy.net> wrote: Neal <ne*****@spamrcn.com> wrote:
A UA configured not to allow new windows will open the link in the existing window (no failure).
Not in each case. I used a popup blocker briefly which required me to Control-click to override the block.
Again: New window != Popup.
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. | | |
Spartanicus <me@privacy.net> wrote: Again: New window != Popup.
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 <ne*****@spamrcn.com> wrote: 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.
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, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/
"Mistakes are the portals of discovery." - James Joyce | | This discussion thread is closed Replies have been disabled for this discussion. Similar topics
3 posts
views
Thread by Lars Schlanbusch |
last post: by
|
2 posts
views
Thread by piraticman |
last post: by
|
2 posts
views
Thread by Stanimir Stamenkov |
last post: by
|
24 posts
views
Thread by Mike |
last post: by
|
9 posts
views
Thread by aragon |
last post: by
|
16 posts
views
Thread by St. Rechsteiner |
last post: by
|
8 posts
views
Thread by pocm |
last post: by
|
2 posts
views
Thread by Matt |
last post: by
|
92 posts
views
Thread by Erwin Moller |
last post: by
| | | | | | | | | | |