How do you find out what version of JavaScript your browser supports?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • wylbur37

    How do you find out what version of JavaScript your browser supports?

    How do you find out what version of JavaScript your browser supports?
    Is there a JavaScript function that will tell you?



    _______________ _______________ ____
    Do you Yahoo!?
    Find out what made the Top Yahoo! Searches of 2003

  • Lasse Reichstein Nielsen

    #2
    Re: How do you find out what version of JavaScript your browsersupports ?

    wylbur37 <wylbur37nospam @yahoo.com> writes:
    [color=blue]
    > How do you find out what version of JavaScript your browser supports?[/color]

    You don't.

    Technically, only Netscape's browsers supports a "version of
    JavaScript", since they are the ones defining the JavaScript
    versions. The versions are summarized here:
    <URL:http://devedge.netscap e.com/library/manuals/2000/javascript/1.5/reference/preface.html#10 03515>

    Microsoft browsers have different versions of JScript, which is mostly
    compatible with Netscape's JavaScript. They use their own version
    numbers.
    <URL:http://msdn.microsoft. com/library/en-us/script56/html/js56jsoriversio ninformation.as p>

    Other browsers implement their version of ECMAScript + DOM and call it
    Javascript, e.g., Opera. They have no version numbers for the Javascript,
    it just evolves with the browser.


    The core language is pretty fixed by now, as everybody are
    implementing ECMAScript v3. The differences are in the interface to
    the browser and document, i.e., the DOM.
    [color=blue]
    > Is there a JavaScript function that will tell you?[/color]

    No.

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • Philip Herlihy

      #3
      Re: How do you find out what version of JavaScript your browser supports?

      It's worth looking at the version info in the property sheet for
      C:\WINDOWS\SYST EM32/jscript.dll

      --
      ############### #######
      ## PH, London ##
      ############### #######


      Lasse Reichstein Nielsen wrote:[color=blue]
      > wylbur37 <wylbur37nospam @yahoo.com> writes:
      >[color=green]
      >> How do you find out what version of JavaScript your browser supports?[/color]
      >
      > You don't.
      >
      > Technically, only Netscape's browsers supports a "version of
      > JavaScript", since they are the ones defining the JavaScript
      > versions. The versions are summarized here:
      >[/color]
      <URL:http://devedge.netscape.com/library/...pt/1.5/referen
      ce/preface.html#10 03515>[color=blue]
      >
      > Microsoft browsers have different versions of JScript, which is mostly
      > compatible with Netscape's JavaScript. They use their own version
      > numbers.
      >[/color]
      <URL:http://msdn.microsoft.com/library/en...6jsoriversioni
      nformation.asp>[color=blue]
      >
      > Other browsers implement their version of ECMAScript + DOM and call it
      > Javascript, e.g., Opera. They have no version numbers for the
      > Javascript, it just evolves with the browser.
      >
      >
      > The core language is pretty fixed by now, as everybody are
      > implementing ECMAScript v3. The differences are in the interface to
      > the browser and document, i.e., the DOM.
      >[color=green]
      >> Is there a JavaScript function that will tell you?[/color]
      >
      > No.
      >
      > /L[/color]


      Comment

      • Fabian

        #4
        Re: How do you find out what version of JavaScript your browser supports?

        wylbur37 hu kiteb:
        [color=blue]
        > How do you find out what version of JavaScript your browser supports?
        > Is there a JavaScript function that will tell you?[/color]

        The best approach is to test within your script for the presence of the
        fucntion you want to use, rather than testing for a version number. In
        other words, test for what it can do, rather than for what it says it
        can do.


        --
        --
        Fabian
        Visit my website often and for long periods!


        Comment

        • Holden Caulfield

          #5
          Re: How do you find out what version of JavaScript your browser supports?

          I agree that doing object detection is usually better than using
          version detection.

          However, in answer to the original question, you could declare a
          variable and then test for increasing versions of javascript such as
          this:

          <script language="javas cript1.1">
          <!--
          var jsver = 1.1
          // -->
          </script>
          <script language="javas cript1.2">
          <!--
          jsver = 1.2
          // -->
          </script>
          [and on and on until Nth version of javascript...]

          Whatever "jsver" is at the end is your highest version CLAIMED to be
          understood.

          Holden

          Comment

          • Thomas 'PointedEars' Lahn

            #6
            Re: How do you find out what version of JavaScript your browser supports?

            Holden Caulfield wrote:
            [color=blue]
            > I agree that doing object detection is usually better than using
            > version detection.[/color]

            You bet! http://pointedears.de.vu/scripts/test/whatami
            [color=blue]
            > However, in answer to the original question, you could declare a
            > variable and then test for increasing versions of javascript such as
            > this:
            >
            > <script language="javas cript1.1">
            > <!--
            > var jsver = 1.1
            > // -->
            > </script>
            > <script language="javas cript1.2">
            > <!--
            > jsver = 1.2
            > // -->
            > </script>
            > [and on and on until Nth version of javascript...]
            >
            > Whatever "jsver" is at the end is your highest version CLAIMED to be
            > understood.[/color]

            I have misguidedly used that years ago. And now -- what should it be
            good for if not reliable? It is exactly the wrong way and thus returns
            the wrong results. For example, IE 6.0 SP-1 on Win2k claims to support
            JavaScript 1.5 but it does not support (not even with updated JScript
            engine) core features specified there and in ECMAScript 3. Besides, the
            above is invalid HTML 4 as the type attribute is missing, and it will
            not validate as HTML 4.01/XHTML 1.0 Strict as the "language" attribute
            is deprecated. OTOH, it is unlikely that you get a result even near to
            truth if you use both the "language" and the "type" attribute.


            PointedEars

            Comment

            Working...