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.
Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dumb question: what's the difference between Xhtml 1.0 and html 4.01?

    i have worked with both langauges profusly, i know each real well...but i never asked this...whats the difference besides pickyness over lowercase letters and indenting? lol stupid question...i know.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Not a stupid question but there are tons of resources out there that can be found with both a simple web search (google) and a forum search. Your question gets asked often, it just takes a little initiative for the user to do some research on their own, key word 'search'. It can't really be explained in one post. There are a lot of things to talk about.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Registered User
    Join Date
    Oct 2006
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts
    oh, well i did my reasearch before i posted and i got a pretty general explaination...what i want to know is what the advantages are to using it.

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    It depends where its being used. A lot of times web designers say that if you can code in XHTML then you are in with the standards. This can be true however IE6 doesn't fully support true XHTML. It sees everything as HTML. Unless you are passing the correct XML headers then you are just sending text/html not text/xhtml.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,634
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Just as one example of why you might choose XHTML rather than HTML.

    The XHTML standards don't allow you to leave out closing tags the way that the HTML standards sometimes allows. Since leaving out a tag means that the browser has to determine where the missing tag needs to be inserted a page with missing tags loads slower than one where they are all defined even though the extra tags makes the code to be downloaded slightly larger and hence slower to download but much faster to render after downloading(assuming you are using something faster than a 300baud acoustic modem where the speed saving on the download would be more significant). Using XHTML allows you to validate that you didn't leave out a tag that will slow the displaying of your page and lose you some visitors. The HTML validator wont flag the missing tags as errors as it allows for the browser adding them for you.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #6
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    Unless you are passing the correct XML headers then you are just sending text/html not text/xhtml.
    Not such MIME type. text/html, text/xml, application/xml and application/xhtml+xml are the valid MIME types for XHTML.

  • #7
    New Coder
    Join Date
    May 2006
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by felgall View Post
    [...] Since leaving out a tag means that the browser has to determine where the missing tag needs to be inserted a page with missing tags loads slower than one where they are all defined even though the extra tags makes the code to be downloaded slightly larger and hence slower to download but much faster to render after downloading(assuming you are using something faster than a 300baud acoustic modem where the speed saving on the download would be more significant). [...]
    Why would a page with optional end tags be faster to parse (with the HTML parser) than a page without optional end tags (with the HTML parser)? That doens't make any sense. The input stream is longer if you include optional tags. The processing is basically the same (e.g., when you hit <p> while inside a paragraph you pop the current paragraph and create a new one; when you hit </p><p> while inside a paragraph you pop the current paragraph then you create a new one).

    Unless you have real tests which confirm any difference in processing in browsers I don't buy your claims. However, even if it was true, the network is almost always slower than the HTML parser, which is why gzip is benefitical for HTML over HTTP, for instance (even though it means more processing).


  •  

    Posting Permissions

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