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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2012
    Posts
    137
    Thanks
    1
    Thanked 1 Time in 1 Post

    How to handle current and older browser versions

    Hello,

    I am a bit confused by all of the doctype declaration changes and how to handle them so that our sites still work back several browser versions. We target mostly IE by the way (it's a long story). We use a lot of jQuery for dynamic content, GUI, custom popups, etc so our site can be slightly temperamental at times. So do I need to detect versions and pass the document accordingly?

    Any help would be appreciated.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,676
    Thanks
    6
    Thanked 1,008 Times in 981 Posts
    Your sites should work with the latest (HTML 5) doctype in all fairly recent browsers, and back to at least IE 6. If anything isn’t working it’s either the HTML itself (e. g. unknown elements, if you are using elements new in HTML 5) or the CSS (styles not implemented into browser, and therefore ignored). Even IE 6 is displaying sites in a relatively decent way if you are in standards mode (i. e. have any doctype declaration), wrote semantic HTML (4), and applied not too advanced CSS.

    You wouldn’t detect versions at all anyway. What you need to detect is features or (support for) objects, not browser versions.

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,640
    Thanks
    0
    Thanked 649 Times in 639 Posts
    <!doctype html> is as valid for HTML 2 as it is for HTML 5 and everything in between and so should work in any browser that supports doctypes.

    Most web sites are mainly written in HTML 3.2 with an occasional HTML 4 or HTML 5 tag thrown in so for most pages specifying the version part of the doctype is not needed (it would only get used if you want to validate your page against a given standard such as HTML 3.2 or HTML 4 strict. HTML 5 isn't a standard yet and so doesn't need a version part in the doctype.
    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.


  •  

    Posting Permissions

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