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 6 of 6
  1. #1
    New Coder
    Join Date
    Dec 2006
    Location
    Philippines
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    identify javascript version

    hello, may i know what function or command will i use to determine what version of javascript that my browser (I.E.6) is CURRENTLY USING? pls note that i am NOT referring to how will i identify the versions that a browser is supporting, but if it is included in the reply..it will still be apprectiated. thanks.

  • #2
    New Coder
    Join Date
    Oct 2006
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <script type="javascript/text">
    document.write(navigator.appVersion); // Version.
    document.write(navigator.appMinorVersion); // Minor version.
    </script>

    Shaffer.
    Last edited by Shaffer; 01-04-2007 at 07:12 AM. Reason: Forgot the [CODE/] clause.

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    IE runs JScript and not Javascript so there is no Javascript version. Which JScript version it is running depends as much on the operating system and service patches as it does on the browser.

    http://javascript.about.com/library/bljver.htm has some deprecated code that can be used to determine what version of Javascript that browsers other than IE are using. For IE it will return a value representing the Javascript version closest to the JScript version that IE is actually running eg if IE is running JScript 5.6 the code will return 1.5 which is the closest Javascript equivalent.
    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.

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    But to find out which is the javascript version or the closest equivalent version seems perfectly useless to me. Why to do that? I guess you should find out which are the common javascript methods for all the browsers, that means you should test for a certain javascript method and see if the browser supports it rather than to test the browser's type/version or the browser's javascript version.

    After all, there is no browser which is able to follow entirely the standards (ECMAScript and DOM), so that there is of no use to test a javascript version.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    It is completely useless. If there were any reason why it could possibly make sense to be able to determine the Javascript version then there would be a method of obtaining that info using valid HTML and Javascript.

    The only method that is able to do it was deprecated long ago and so future browsers may not even support the code needed to do it.

    The only possible use for such a determination would be if gahering statistics although what use such statistics would have is another question that can probably be answered with "none".
    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
    New Coder
    Join Date
    Dec 2006
    Location
    Philippines
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts
    ok..ok, thanks to all of you who gave those logical explaination on the necessity of NOT getting the version of a javascript. all of your ideas were carefully noted.


  •  

    Posting Permissions

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