Click here to get back home

HTML4.01 STRICT and hyperlinks with target

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
HTML4.01 STRICT and hyperlinks with target Erwin Moller 10-08-2008
Get Chitika Premium
Posted by Erwin Moller on October 8, 2008, 4:26 am
Please log in for more thread options



Hi group,

I encoutered page validation error, but I don't know a way around.

The page has the following doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

Some hyperlinks need to open to a new window, so I used the (wrong)
target="" attribute.

w3c validation gave me this:

---------------------------------------------------------------
Validation Output: 1 Error
---------------------------------------------------------------
1. Error Line 13, Column 108: there is no attribute "TARGET".

…="http://www.example.com" target="_blank">mylink</a> en

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.

How to fix: check the spelling and case of the element and attribute,
(Remember XHTML is all lower-case) and/or check that they are both
allowed in the chosen document type, and/or use CSS instead of this
attribute. If you received this error when using the <embed> element to
incorporate flash media in a Web page, see the FAQ item on valid flash.
---------------------------------------------------------------


My question: How do I use the good old target in hyperlinks without
JavaScript?

Thanks for your time.

Regards,
Erwin Moller



--
============================
Erwin Moller
Now dropping all postings from googlegroups.
Why? http://improve-usenet.org/
============================

Posted by CJM on October 8, 2008, 5:01 am
Please log in for more thread options


You have 3 choices:
- don't try to specify the target window, and let the use choose (preferred
by the purists)
- use javascript; such that the page validates, but the target of each link
is changed on load (the validating compromise workaround)
- use target attribute as normal, and just ignore the validation errors.

To me, validation is a means to an end. And for many of my sites and
applications, I actively want the (usually external) link to open in a new
window. Often I don't want to leave it up to a user - usually because my
user-base couldn't shift-click/ctrl-click/right-click if their life depended
on it (even with on-screen prompts), but often because I'm developing
applications that need to behave in a set way. In these cases, I don't want
to leave the choice up to the user, any more than I would allow them to
choose in one of my desktop applications.

For more conventional, internet-facing websites (as opposed to intranet
applications), I do tend to leave the choice up to the user, but not always.

This will be a contraversial post in this NG, but I think my stance is a
popular one. However, I would like to see a change in the standards to allow
an attribute that 'suggests' a target and allow the users browser settings
to determine whether they want to accept the default suggestions, or make
their own choices. I think this would appeal to the purists, but still cater
for the masses.
Just my £0.02.


Posted by Erwin Moller on October 8, 2008, 5:46 am
Please log in for more thread options



CJM schreef:
> You have 3 choices:
> - don't try to specify the target window, and let the use choose
> (preferred by the purists)
> - use javascript; such that the page validates, but the target of each
> link is changed on load (the validating compromise workaround)
> - use target attribute as normal, and just ignore the validation errors.
>
> To me, validation is a means to an end. And for many of my sites and
> applications, I actively want the (usually external) link to open in a
> new window. Often I don't want to leave it up to a user - usually
> because my user-base couldn't shift-click/ctrl-click/right-click if
> their life depended on it (even with on-screen prompts), but often
> because I'm developing applications that need to behave in a set way. In
> these cases, I don't want to leave the choice up to the user, any more
> than I would allow them to choose in one of my desktop applications.
>
> For more conventional, internet-facing websites (as opposed to intranet
> applications), I do tend to leave the choice up to the user, but not
> always.
>
> This will be a contraversial post in this NG, but I think my stance is a
> popular one. However, I would like to see a change in the standards to
> allow an attribute that 'suggests' a target and allow the users browser
> settings to determine whether they want to accept the default
> suggestions, or make their own choices. I think this would appeal to the
> purists, but still cater for the masses.
> Just my £0.02.

Hi CJM,

Thank you for your clear response.
So the conclusion is that STRICT doctype simply forbids this useful
attribute.
That is annoying. In my humble opinion, this is a designmistake of w3c
for strict doctype. If you throw something out of the window, at least
offer a method/way of doing the same (in a different way).

Since it isn't up to me as the developer to demand JavaScript of my
(internet) clients, I don't want a JavaScript solution.
I think I follow your option 3: Simply use target and ignore the
validation error.

Thanks.

Regards,
Erwin Moller


--
============================
Erwin Moller
Now dropping all postings from googlegroups.
Why? http://improve-usenet.org/
============================

Posted by viza on October 8, 2008, 7:33 am
Please log in for more thread options


Hi

On Wed, 08 Oct 2008 12:48:36 +0200, Erwin Moller wrote:
> viza schreef:
>> On Wed, 08 Oct 2008 11:46:33 +0200, Erwin Moller wrote:

>> No, making your users have to alt-tab back to the previous window and
>> close it and then switch back to the new one is annoying. It discards
>> the history and puts the window's icon in a different place in the
>> taskbar.
>
> I know.
> But in some situations it is better than full pagereloads (or demanding
> JavaScript).

It never is.

>>> In my humble opinion, this is a designmistake of w3c for strict
>>> doctype. If you throw something out of the window, at least offer a
>>> method/way of doing the same (in a different way).
>>
>> They have done exactly that. It is called "transitional". This is the
>> whole point and explicit purpose of transitional.
>
> That doesn't explain the removal of the target. I want to use STRICT to
> make sure my pages are well build.

It is very simple: well built pages do not use target. Pages that use
target use transitional to indicate that to the browser.

> It is very simple:
> -> If you hate the use of multiple windows, you don't use target="". ->
> If you DO want to offer it, you use target="".

Who is "you"? What matters is what the user hates, not you as the
developer.

> Leave it to the designer of the webpage. Putting this into the
> definition of STRICT doctype is way too paternalizing for my taste.

No one at the w3c is trying to stop you from using target. If you choose
to not use it then you can mark your pages as strict. If you choose to
use it then you should mark them as transitional. Deciding on strict
when you don't like what strict means is what causes you this problem.

>> I think that you are confused as to your purpose. If you are
>> developing an intranet application and just happen to be using
>> http/html to do it, then use javascript.
>
> This app is for the internet at large. I want to write good HTML, and
> decided much earlier to use STRICT.

Good html, for use on the world-wide-web never ever under any
circumstances uses the target attribute.

Your misuse of terminology betrays your misunderstanding. You think you
are making an application, but applications are not part of the wwweb.
If you are making an application, you can do what you like, but you
should be aware of which users you are excluding. Conversely, if you are
developing for the wwweb, then you need to be aware what good web pages
simply cannot do.

> As far as I understood the reasoning behind the STRICT doctype, it was
> all about reducing the mess that HTML had become. So I really try to use
> CSS in the way w3c has visioned, and remove a lot of markup from my
> HTML. And I like it. I simply wasn't aware of the fact w3c removed stuff
> without reasonable replacement.

Strict + css is about a logical change separating the presentation of
information from the data and metadata itself. That means letting the
html links contain the relationship between resources and letting the
browser and user decide how to display them. You need to decide if you
agree with this change. If you do, then use strict. If you don't, then
use target.

viza

Posted by Erwin Moller on October 8, 2008, 8:47 am
Please log in for more thread options



viza schreef:
> Hi
>
> On Wed, 08 Oct 2008 12:48:36 +0200, Erwin Moller wrote:
>> viza schreef:
>>> On Wed, 08 Oct 2008 11:46:33 +0200, Erwin Moller wrote:
>
>>> No, making your users have to alt-tab back to the previous window and
>>> close it and then switch back to the new one is annoying. It discards
>>> the history and puts the window's icon in a different place in the
>>> taskbar.
>> I know.
>> But in some situations it is better than full pagereloads (or demanding
>> JavaScript).
>
> It never is.

Hi Viza,

It never is? Quite a statement.

Please consider the following real life situation:
1) A certain page is produced by PHP as a result from some huge
databasequery that is quite demanding for the server.

2) The user must select many tuples for editting.

This is the moment I REALLY want a new window. The clicked tuple will
open in it, in a form, ready for editting and submitting back to the
server.
The server now only has to query one tuple, and I put it in a form. Easy
enough for the user, and easy for the server too.

If I do NOT have the luxery of a new window, I must reload the whole
page, and open the tuple in an edit-form.

This leads to:
1) Heavy serverload
2) Annoyed users (who must wait for each and every edittingaction)

In most circumstances I use an Ajaxoid approach to do this, but I am not
always allowed to demand JavaScript. In that situation a new window is
ideal.
(Using Ajax would have the advantage for me that I can update the huge
page without a huge pagereload, so I can immediately reflect the
changes. But no JavaScript means of course no Ajax.)

Please comment on the above scenario.
I totally miss target="" in STRICT in the described situation.


>
>>>> In my humble opinion, this is a designmistake of w3c for strict
>>>> doctype. If you throw something out of the window, at least offer a
>>>> method/way of doing the same (in a different way).
>>> They have done exactly that. It is called "transitional". This is the
>>> whole point and explicit purpose of transitional.
>> That doesn't explain the removal of the target. I want to use STRICT to
>> make sure my pages are well build.
>
> It is very simple: well built pages do not use target. Pages that use
> target use transitional to indicate that to the browser.
>
>> It is very simple:
>> -> If you hate the use of multiple windows, you don't use target="". ->
>> If you DO want to offer it, you use target="".
>
> Who is "you"? What matters is what the user hates, not you as the
> developer.

No go there.
As you mentioned yourself you, the webdeveloper, can use transitional
doctype, and have a (legal) target.
So it IS already up to the developer.

Wise builders try not to annoy their users of course.
But saying a new window is always an annoyance is not a fact, but a
matter of taste.
That is why I don't understand it is removed in the STRICT doctype.
I read up a little more since my original post: I am not excactly the
first one that thinks this is a mistake of w3c.


>
>> Leave it to the designer of the webpage. Putting this into the
>> definition of STRICT doctype is way too paternalizing for my taste.
>
> No one at the w3c is trying to stop you from using target. If you choose
> to not use it then you can mark your pages as strict. If you choose to
> use it then you should mark them as transitional. Deciding on strict
> when you don't like what strict means is what causes you this problem.

Yes, that is completely clear to me.
What is not clear is WHY it is removed in the STRICT doctype.

>
>>> I think that you are confused as to your purpose. If you are
>>> developing an intranet application and just happen to be using
>>> http/html to do it, then use javascript.
>> This app is for the internet at large. I want to write good HTML, and
>> decided much earlier to use STRICT.
>
> Good html, for use on the world-wide-web never ever under any
> circumstances uses the target attribute.
>
> Your misuse of terminology betrays your misunderstanding. You think you
> are making an application, but applications are not part of the wwweb.
> If you are making an application, you can do what you like, but you
> should be aware of which users you are excluding. Conversely, if you are
> developing for the wwweb, then you need to be aware what good web pages
> simply cannot do.

Don't worry about my (mis)understanding of what an application is.
I have been a webdeveloper/databasedesigner/gamedeveloper for over 12
years now. Nothing wrong with calling a complex databasedriven bunch of
webpages a(n) (web)application.
But this has little to do with the subject at hand.

>
>> As far as I understood the reasoning behind the STRICT doctype, it was
>> all about reducing the mess that HTML had become. So I really try to use
>> CSS in the way w3c has visioned, and remove a lot of markup from my
>> HTML. And I like it. I simply wasn't aware of the fact w3c removed stuff
>> without reasonable replacement.
>
> Strict + css is about a logical change separating the presentation of
> information from the data and metadata itself. That means letting the
> html links contain the relationship between resources and letting the
> browser and user decide how to display them. You need to decide if you
> agree with this change. If you do, then use strict. If you don't, then
> use target.

True.
I cannot change the STRICT doctype.
I am merely claiming it was a stupid decision of the w3c.

Right now I am in the difficult stituation I have to choose between
STRCIT and TRANSITIONAL doctype.
And I liked the STRICT a lot and was planning on using it for every new
project I start.
And yes, that is my problem, not yours.
But that doesn't mean w3c screwed up. :-(

>
> viza

Regards,
Erwin Moller


--
============================
Erwin Moller
Now dropping all postings from googlegroups.
Why? http://improve-usenet.org/
============================

Similar ThreadsPosted
Re: HTML4.01 STRICT and hyperlinks with target October 8, 2008, 5:14 pm
html4/strict.dtd & IE/firefox problem April 21, 2005, 9:34 am
Real advantages in using HTML4 strict vs XHTML Translational? November 15, 2007, 12:28 pm
target in strict doctype December 16, 2007, 12:40 pm
DOCTYPE Strict and target="_blank" August 18, 2006, 11:07 am
Strict HTML: mimic target tag/favicon location? October 4, 2008, 6:32 am
Strict HTML: mimic target tag/favicon location? October 5, 2008, 1:44 pm
Is Html4.01 spec(http://www.w3.org/TR/REC-html40/) downly compatible to older editions such like Html4.0? April 20, 2005, 3:26 am
hyperlinks question July 21, 2004, 8:07 pm
help with url hyperlinks (question) February 22, 2005, 6:04 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap