0

I can't seem to find any information, but i have Firefox version 24 and when i look at the version of javascript that it uses, i get version 1.5. This is giving me constant headaches because i should have the 1.6 version. I have many bugs and problems with my javascript code related to this problem.

Does anyone know why FF ships with version 1.5 and how can i get the 1.6? I allready lookt up the mozilla forums and developer network, but no help there.

All my other browsers, safari, chrome and opera have newer javascript versions.

See this fiddle:

kevinius
  • 4,232
  • 7
  • 48
  • 79
  • 2
    how do you check for javascript version? as per [the reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference#JavaScript.2FBrowser_support_history), the version should already be 1.8+. – eis Sep 23 '13 at 07:41
  • I used this script: http://stackoverflow.com/questions/4271566/how-do-i-tell-what-version-of-javascript-im-using – kevinius Sep 23 '13 at 07:45

1 Answers1

3

JavaScript is the original name that Mozilla gave to the language (LiveScript really, but that's history now). All browsers implement ECMAScript, what we know today as JavaScript. JavaScript 1.x is the internal versioning of Mozilla's implementation of ECMAScript. You should be comparing supported features not different implementations of the language since they all implement the same standard, ECMA.

elclanrs
  • 92,861
  • 21
  • 134
  • 171
  • How do i compare features? For example, getElementsByTagName returns a HTMLCollection in FF and in Safari it returns a nodeList. – kevinius Sep 23 '13 at 07:44
  • Can you point to a live demo? What's the problem you're experiencing exactly? – elclanrs Sep 23 '13 at 07:46
  • http://jsfiddle.net/cWV9N/3/ ... the getElementsByTagName gives me a return type of HTMLCollection instead of nodeList like in safari and all other browsers – kevinius Sep 23 '13 at 07:49
  • +1 Nitpicking: Except Brendan worked at Netscape (not Mozilla) at the time Mocha/LiveScript/JavaScript was invented. –  Sep 23 '13 at 07:49
  • Here's another description of the problem: http://domwtf.com/post/35410456541/htmlcollection-vs-nodelist – kevinius Sep 23 '13 at 07:53
  • pfft, what's going on... my chrome Version 29.0.1547.76 says nodeList. The only thing that is a HTMLCollection is the getElementById – kevinius Sep 23 '13 at 07:55
  • ECMAScript standard also has different versions of the standard, so I'm not sure if this answer makes sense. They implement different versions of the standard, so it does make sense to compare them. As to which one is better, that's another discussion. – eis Sep 23 '13 at 07:58
  • Not sure we're testing the same thing here. I get nothing on getElementById in both browsers. Here's a screenshot. http://i.imgur.com/j0Q4ffs.jpg – elclanrs Sep 23 '13 at 07:58
  • @elclanrs you have to click on one of the links, the object type apears in the input field – kevinius Sep 23 '13 at 07:59
  • @eis: That's sort of an obvious assumption. "Modern" browsers compete, plus the web is moving towards proper standards; once IE8 is gone we won't have to worry about supporting different versions of ECMAScript, unless we want the bleeding edge, but that's not standard... – elclanrs Sep 23 '13 at 08:02
  • @kevinius: I see now. IMO don't worry about it, I don't think it makes a difference in practice. The methods of HTMLCollection and NodeList are practically the same. Is there an actual problem due to this issue that you have encountered? – elclanrs Sep 23 '13 at 08:05
  • @elclanrs yes, i can't get to the nodeType. Still in my example (http://jsfiddle.net/cWV9N/3/) if you click on getElementById you see the number 1 next to it's type. If you click on getElementsByTagName you get 'undefined' – kevinius Sep 23 '13 at 08:29
  • @kevinius: That's because it returns a **collection** of elements, that's what HTMLCollection is (or NodeList). You'd have to loop and access by index. http://jsfiddle.net/cWV9N/4/ – elclanrs Sep 23 '13 at 08:32
  • Thx... but if HTMLCollection and NodeList are the same, then way can i access the nodeType of the HTMLCollection using jow.nodeType? – kevinius Sep 23 '13 at 08:54
  • I think you're just complicating things, I don't see any real world problem here; when you have a collection of elements, you get a pseudo-array, you need to loop to access the properties of each individual element. If `jow` is a collection then `jow.nodeType` doesn't make sense. – elclanrs Sep 23 '13 at 09:01
  • If you want you can just convert that collection into a real array of elements, and it will be represented the same in both browsers. Just do this: `var elements = [].slice.call(collection)`, and now `elements` is a **real** array of single nodes. – elclanrs Sep 23 '13 at 09:04