How Can I Determine Which Version of JS I'm Using

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • poe
    New Member
    • Jun 2007
    • 32

    How Can I Determine Which Version of JS I'm Using

    Hello,

    I have a couple of JavaScript functions that use AJAX to dynamically lookup a geocode from Google Maps and display the accuracy to the user. I've had reports that this JavaScript breaks in their browser, but I have been unable to reproduce any of the errors. I've used several JavaScript validators and feel assured I have properly constructed JavaScript. It seems that their browser may not have a high enough version of JavaScript to support the features, but I don't know how to determine, easily, which version of JavaScript I'm using and, therefore, which version of JavaScript I need to require to visit the page.

    Any help would be great!

    Thanks,
    Justin
  • Dasty
    Recognized Expert New Member
    • Nov 2007
    • 101

    #2


    But I bet your problems are not because of low javascript version, but because of how different browsers implement same functions. For that reason I am always testing my codes at least at:

    FF, Opera, IE7 and IE6

    Install all of them and test it (or ask users that have problems with your site what kind of browser / version) are they using. Because standards / validator results are one thing and reality is different one.

    Comment

    • poe
      New Member
      • Jun 2007
      • 32

      #3
      Thanks for the reply. I'm creating a test page that users can hit when they call in with the problem so they can help diagnose it.

      I'll post my results back if I find anything interesting.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Instead of trying to determine the version of JavaScript, use object/feature detection everywhere, e.g. if you want to support a really old browser, you could put:
        [CODE=javascript]if (document.image s) {
        // code dealing with document.images[/CODE] so it degrades gracefully in old browsers and likewise for anything you use in your code.

        Comment

        Working...