Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    329
    Thanks
    3
    Thanked 19 Times in 19 Posts

    Macintosh DOCTYPE (again!!)

    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.

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #3
    Senior Coder
    Join Date
    Oct 2005
    Posts
    1,340
    Thanks
    0
    Thanked 61 Times in 60 Posts
    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.

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    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.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Quote Originally Posted by drhowarddrfine View Post
    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.

  • #6
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    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.

  • #7
    Senior Coder
    Join Date
    Oct 2005
    Posts
    1,340
    Thanks
    0
    Thanked 61 Times in 60 Posts
    Quote Originally Posted by Bill Posters View Post
    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)

  • #8
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Quote Originally Posted by drhowarddrfine View Post
    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.
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    will render in quirks mode, but it's still valid.
    Code:
    <!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.
    Code:
    <!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.
    Quote Originally Posted by drhowarddrfine View Post
    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.
    Last edited by Apostropartheid; 11-14-2008 at 11:08 PM.

  • #9
    Senior Coder
    Join Date
    Oct 2005
    Posts
    1,340
    Thanks
    0
    Thanked 61 Times in 60 Posts
    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.

  • #10
    Regular Coder
    Join Date
    Nov 2005
    Posts
    329
    Thanks
    3
    Thanked 19 Times in 19 Posts
    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!

  • #11
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Quote Originally Posted by drhowarddrfine View Post
    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'

    See also:
    https://developer.mozilla.org/en/Moz...Standards_Mode

  • #12
    Senior Coder
    Join Date
    Oct 2005
    Posts
    1,340
    Thanks
    0
    Thanked 61 Times in 60 Posts
    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.

  • #13
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Quote Originally Posted by drhowarddrfine View Post
    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.

  • #14
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,695
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    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 method as it’s more a progressive enhancement approach rather than the approach of graceful degradation.

  • #15
    Regular Coder
    Join Date
    Nov 2005
    Posts
    329
    Thanks
    3
    Thanked 19 Times in 19 Posts
    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!


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •