SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Mar 2009
    Location
    Zagreb, Croatia
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Are the Browser Objects standardized somewhere?

    So, we have the JavaScript native objects: Object, Function, Array, String, Number, Boolean, Date, Math, RegExp, Error ....

    Then we have the DOM interfaces... the most important object that applies those interfaces is the document object...

    But also, there are the Browser Objects: window, location, screen, history, navigator.

    The JavaScript objects are defined in the ECMAScript standard, the DOM interfaces are part of the DOM standards, but where are the Browser Objects standardized? Nowhere?

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,789
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by VidASP View Post
    where are the Browser Objects standardized? Nowhere?
    That's right - they don't have a written standard anywhere.

    For the most part though all browsers except for Internet Explorer set them up the same way as defined in the original Mozilla browser.

    Since Internet Explorer uses two alternatives depending on whether a strict or transitional doctype is used that means you usually only have two places to look with code to be used only on your own site and three places to look if you are writing code to be shared with other sites.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Member
    Join Date
    Mar 2009
    Location
    Zagreb, Croatia
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I hope you are talking about IE6... I'll be sure to check out IE8 compatibility, that's the only IE version I care about.

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,789
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by VidASP View Post
    Well, I hope you are talking about IE6... I'll be sure to check out IE8 compatibility, that's the only IE version I care about.
    No I meant ALL versions of IE store much of the browser info in different locations from where other browsers store it. There is no standard to tell IE that their locations are wrong.

    You just need to use feature sensing to detect which of the three places actually holds a value and use the one from there.

    See http://javascript.about.com/od/brows...odel/a/bom.htm for information on what parts of the BOM contain what info in which browsers and how to create cross browser processing for the useful ones that use different locations.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

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