/    Sign up×
Community /Pin to ProfileBookmark

Strict vs. Transitional

I am very new to webdesign, and yet it is kind of my job at the moment. Is there any valid reason to use Strict HTML instead of Transitional? I don’t use too many features that aren’t available in Strict, but it would still be a pain to switch, so is there any reason that I should?

to post a comment
HTML

13 Comments(s)

Copy linkTweet thisAlerts:
@the_treeJun 14.2006 — Keeping with the times, having slightly more efficient code, slightly quicker load times, an amusing challenge.
Copy linkTweet thisAlerts:
@felgallJun 14.2006 — The only reason for using a Transitional DOCTYPE is for old pages that you are trying to update to use more current standards but which you haven't had time to remove all of the deprecated elements from yet. For new pages you should always use Strict.

The most significant difference between the two is that Transitional allows the use of tags and attributes that the current browser versions still support but which are no longer a part of the standards and are expected to not be supported by future browsers. You should not be using those tags and attributes for new development.
Copy linkTweet thisAlerts:
@kiwibritJun 14.2006 — The only reason for using a Transitional DOCTYPE is for old pages that you are trying to update to use more current standards but which you haven't had time to remove all of the deprecated elements from yet. For new pages you should always use Strict.

The most significant difference between the two is that Transitional allows the use of tags and attributes that the current browser versions still support but which are no longer a part of the standards and are expected to not be supported by future browsers. You should not be using those tags and attributes for new development.[/QUOTE]


I think there is a case for using transitional, sparingly, for target="_blank". I have almost entirely binned it - but am using it for a case where a larger image is required of a thumbnail. Specifically, a large image of a cloth when only a series of small samples is appropriate in a main page, but I want to be able to open up larger samples in a small focused window in javascript, yet allow a straightforward new window for non-javascript users.
Copy linkTweet thisAlerts:
@CharlesJun 15.2006 — I think there is a case for using transitional, sparingly, for target="_blank". I have almost entirely binned it - but am using it for a case where a larger image is required of a thumbnail. Specifically, a large image of a cloth when only a series of small samples is appropriate in a main page, but I want to be able to open up larger samples in a small focused window in javascript, yet allow a straightforward new window for non-javascript users.[/QUOTE]Well and good but it is almost always better to use JavaScript to open that new window. People without JavaScript running don't want you opening a new window.

If you're using frames, however, you need to use "target" attribute and transitional DTD - until XFRAMES take hold.
Copy linkTweet thisAlerts:
@kiwibritJun 15.2006 — Well and good but it is almost always better to use JavaScript to open that new window. People without JavaScript running don't want you opening a new window.........[/QUOTE]
Generally, I agree with you. However, in this [url=http://www.shy.co.uk/cloths-option.php]draft new page[/url] (it's still being developed and is not linked to from the main site, and is banned by robots.txt) the cloth samples are representative of a much larger number that will be on the final page. The small images give an idea of what the cloth will look like - the larger images give a much better idea. Popping up a window is an ideal way of doing that - and I think it is acceptable for non-javascript users to have a new window, too, provided that they are warned. After all, users will be browsing a series of cloths, rather than wishing to go to a different destination, per se, in the site. When browsing the cloths, it seems logical that the main cloths page should remain open.

It also keeps the link mark up simple.

I do use target="_blank" (and so transitional coding) very exceptionally, though.
Copy linkTweet thisAlerts:
@WaylanderJun 15.2006 — I used to have problems with the target=blank not being included... but those who have commented are right, Javascript is the right way to do it.

Strict is not worth sacrificing for it.

If the person is browsing the web with javascript disabled they can hold control to get the link in a new tab or just deal with the problem, its extra functionality that doesnt belong in a x/html document.

I often use something simple like this for off-site links:

[CODE]function externalLinks()
{
if (document.getElementsByTagName)
{
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++)
{
var hrefValue = anchors[i].href.toString();
var expression = /(your-domain-here)|(validator)/;
if ( !( hrefValue.match(expression) ) )
{

anchors[i].onclick = function()
{
show = window.open(this.href);
show.window.focus();
return false;
}
}
}
}
}[/CODE]


Simply run the script in onload, it will go through the a tags and solve the problem... no need to even edit your x/html script.

Its also easy to put pages you want into a unique sub-directory and then just include the directory name in the regular expression. The validator part of the regex ensures that x/html and css validators run correctly too.

Waylander.
Copy linkTweet thisAlerts:
@kicken18Jun 15.2006 — You say your new the web developing, and going on about HTML, I do dhope your using XHTML and not HTML ?
Copy linkTweet thisAlerts:
@kiwibritJun 15.2006 — You say your new the web developing, and going on about HTML, I do dhope your using XHTML and not HTML ?[/QUOTE]

I am not new to web page development - I said the page itself (which already does use javascript to open the new windows, Waylander) was under development.

Assuming you subscribe to webmaster world, have a look at this [url=http://www.webmasterworld.com/forum21/12026-2-10.htm] 8-page thread entitled "Why most of us should NOT use XHTML"[/url].

Enjoy.
Copy linkTweet thisAlerts:
@kicken18Jun 15.2006 — hmm very intresting, I wasnt even awear of any problems with it. Hmm it might explain a weird problem I am having at work at the min, I will have to investigate. Thanks for putting my stright
Copy linkTweet thisAlerts:
@Frankie_CWRUauthorJun 15.2006 — I have removed almost all of the deprecated attributes from my code, but I am still using one target= _blank, and was wondering how to get rid of it. I have a javascript login, which opens a small window, and that all works fine, but I want people with javascript disabled to still be able to login, and so in a <noscript> block I am using a target=_blank.

Should I just open the login in the same window and then have a link back to the main page for users without javascript? or is there some way to open a link in a new window without using the target attribute?
Copy linkTweet thisAlerts:
@kiwibritJun 15.2006 — Why not use server side logging-in for all?
Copy linkTweet thisAlerts:
@Frankie_CWRUauthorJun 15.2006 — Sorry, the actual login isn't done with javascript, i only use it to open the login page, here is my code.

<?php

echo "<input type = "button" value = "Sign In" onClick="window.open('Login.php','SignIn', 'width=200, height=200')" id="login">";

?>

and

<noscript>

...

<a href="Login.php" target=_blank>Login</a>

...

</noscript>
Copy linkTweet thisAlerts:
@kiwibritJun 15.2006 — I'd be inclined to have a log-in / register boxes up on the page without requiring javascript - ie on permanent display. Otherwise, I'd simply have a separate page for all. If you want to open a new window in straightforward HTML, you will either have to use target=_"blank" or rely on the user right clicking.
×

Success!

Help @Frankie_CWRU spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...