...

View Full Version : DOCTYPE (again!!)



Avril
11-14-2008, 06:55 AM
Hi!

Whenever I try to validate a page in which I have embedded a flash movie, the W3C validator refuses all the objet and embed tags, even if the rest of the tags are valid. What is the reason, and what should be the DOCTYPE (or additional info) I should add to a regular DOCTYPE, for example, to:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

Any help will be appreciated.

Thank you.

rangana
11-14-2008, 09:23 AM
http://www.alistapart.com/articles/flashsatay

drhowarddrfine
11-14-2008, 03:38 PM
The article above explains it. Don't worry about the doctype. The doctype only tells the browser what rules you are following. It does not affect coding.

abduraooft
11-14-2008, 03:58 PM
The doctype only tells the browser what rules you are following. It does not affect coding. But it may affect the functionality of the website(across browsers) if we supply an invalid code.

Bill Posters
11-14-2008, 03:59 PM
The article above explains it. Don't worry about the doctype. The doctype only tells the browser what rules you are following. It does not affect coding.

Well, it does and it doesn't. The doctype you use can influence how the browser parses and renders your code.
There are potential differences between how a site might render under a Transitional doctype and a Strict doctype.

Apostropartheid
11-14-2008, 05:24 PM
These differences aren't just potentional: they are very real. Many DOCTYPEs, especially incomplete ones, trigger quirks mode. You should always use a Strict DOCTYPE for new documents released after the standard has been introduced. And it makes it a hell of a lot easier to troubleshoot for us.

drhowarddrfine
11-14-2008, 06:21 PM
Well, it does and it doesn't. The doctype you use can influence how the browser parses and renders your code.
There are potential differences between how a site might render under a Transitional doctype and a Strict doctype.
Not true. The only thing that cares about which of those two doctypes you use is the validator. Either of those will cause browsers to render standard html/css the same. Anything else puts them into quirks where they will render differently, but no one should be using quirks anyway.

These differences aren't just potentional: they are very real. Many DOCTYPEs, especially incomplete ones, trigger quirks mode.An incomplete doctype, therefore, isn't a doctype at all but gibberish and the browser will treat it as such and go into quirks.

The point is, the very first thing to go on a page is the doctype before anything else. And then it never changes. I sometimes see people changing doctypes to see if they can get their page to render the way they want it but that's the wrong thing to do. You start with one set of 'rules' and stick with them. (I'm wondering if I'm going OT on this now)

Apostropartheid
11-15-2008, 12:06 AM
Not true. The only thing that cares about which of those two doctypes you use is the validator. Either of those will cause browsers to render standard html/css the same. Anything else puts them into quirks where they will render differently, but no one should be using quirks anyway.
Um, yes, the browsers really do care.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">will render in quirks mode, but it's still valid.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">will render in almost standards mode, and is as valid.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">will always render in standards mode, and is just as valid.

An incomplete doctype, therefore, isn't a doctype at all but gibberish and the browser will treat it as such and go into quirks
An incomplete DOCTYPE--i.e. one without a system identifier--is perfectly permissible in standard HTML and is valid. I believe this is a leftover from SGML. However, it's not allowed in languages descended from XML, like XHTML.

drhowarddrfine
11-15-2008, 01:51 AM
You aren't talking of the same thing I am. I said "either of those two doctypes", meaning "transitional" vs "strict". A proper doctype, whether transitional or strict, will render the same in a browser. Only the validator cares because it is checking for older markup that falls under the transitional heading. The browser doesn't care and renders them the same.

If you are talking of using quirks, then that's a different subject. As I said, no one has a reason to ever use quirks.

Avril
11-15-2008, 08:20 PM
Hi! I'm back after a break ...

What I was trying to say is that my coding is valid, except for the Flash coding generated by Flash. It always comes up as a list of errors.

Thanks Rangana for the link, but being just a humble designer, the explanations are a bit over my head.
"I created a new Flash movie and put the following ActionScript on Frame 1 right in the root of the movie:
_root.loadMovie(_root.path,0);"

... in the root of the movie ?? Where do I find it? (The rest is simple enough).

Thanks a lot to all of you for your answers, but, as I said my own coding with the doctype I used (above) was quite valid.

Cheers!

Bill Posters
11-16-2008, 10:00 AM
You aren't talking of the same thing I am. I said "either of those two doctypes", meaning "transitional" vs "strict". A proper doctype, whether transitional or strict, will render the same in a browser. Only the validator cares because it is checking for older markup that falls under the transitional heading. The browser doesn't care and renders them the same.

FYI, 'amost standards mode' (http://en.wikipedia.org/wiki/Quirks_mode#Almost_standards_mode)

See also:
https://developer.mozilla.org/en/Mozilla%27s_DOCTYPE_sniffing#Almost_Standards_Mode

drhowarddrfine
11-16-2008, 03:09 PM
You can continue to find non-standard exceptions all day long but my statement still stands. And, still, no one has any reason in the world to use quirks or 'almost standard' for new pages.

Bill Posters
11-16-2008, 03:54 PM
You can continue to find non-standard exceptions all day long but my statement still stands.
The fact that 'non-standard exceptions' exist - and can create differences between how the same code will render under a Transitional doctype and a Strict doctype - means that your statement is wrong.

Standing by a statement which is provably wrong is your choice, of course.
Each to their own.

I mean no malice in my bringing attention to 'almost standards mode'.


And, still, no one has any reason in the world to use quirks or 'almost standard' for new pages.
Don't get me wrong. I won't use or endorse anything less than a full and complete Strict doctype. For a live or incremental rebuild, I'll invariably institute a Strict doctype (though never say never). As you say, for a new build, there's really no need nor any excuse to be using anything less than Strict.

The issue I had with your statement (about Transitional and Strict producing the same rendering outcome) is that some (quite probably most) might take it at face value and be using a Transitional doctype (triggering 'almost standards' mode in some browsers) without realising it, whilst erroneously believing that they've put the browser on very best behaviour.

I'm not trying to undermine your position, just make your statement a wee bit more accurate.

VIPStephan
11-16-2008, 07:04 PM
Avril, to come back to the actual question: What’s invlid with your code is the <embed> element. That’s not part of the standards defined by the W3C and because there are different (and valid) ways to implement a Flash object embed shouldn’t be used.

As far as I remember “Flash Satay” is nesting two object elements to cater for IE or other browsers. I, however, prefer the SWFobject (http://code.google.com/p/swfobject/) method as it’s more a progressive enhancement (http://en.wikipedia.org/wiki/Progressive_enhancement) approach rather than the approach of graceful degradation.

Avril
11-17-2008, 06:00 AM
Hi, VIP! Thank you. The SWFobject method is exactly what I was looking for, and it's well explained. There's nothing like clean, concise coding, is there?

Cheers!

VIPStephan
11-17-2008, 12:39 PM
There's nothing like clean, concise coding, is there?

You’ve got the point! :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum