在浏览器中支持不同的 Javascript 版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4063953/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 10:17:59  来源:igfitidea点击:

Support of different Javascript versions in browsers

javascriptbrowserversion

提问by Pablo Fernandez

Surfing the MDC docs here, I've noticed there are quite a few versions of javascript (1.6 to 1.8.5).

这里浏览 MDC 文档,我注意到有很多版本的 javascript(1.6 到 1.8.5)。

I was wondering:

我想知道:

  1. Is there any online reference for Browser / Javascript version supported ?

  2. Is there any practical application for the use of different javascript versions ? According to MDC you need to do something like this to use them:

  1. 是否有任何支持浏览器/Javascript 版本的在线参考资料?

  2. 是否有使用不同 javascript 版本的实际应用?根据 MDC,您需要执行以下操作才能使用它们:

<script type="application/javascript;version=1.7"/>

<script type="application/javascript;version=1.7"/>

Which I haven't seen in any website IIRC.

我在任何网站 IIRC 上都没有看到过。

Thanks!

谢谢!

采纳答案by Harmen

1)Yes, on Wikipedia is a nice list: http://en.wikipedia.org/wiki/JavaScript#Version_history

1)是的,维基百科上有一个不错的列表:http: //en.wikipedia.org/wiki/JavaScript#Version_history

2)For websites it's not a good idea to use newer versions of Javascript, but for plugins for newer browsers it can be helpful. For example, I'm using the forEachfunction in plugins for Google Chrome

2)对于网站,使用较新版本的 Javascript 不是一个好主意,但对于较新浏览器的插件,它可能会有所帮助。例如,我forEach在 Google Chrome 插件中使用该功能

回答by Nick Craver

  1. Wikipedia has a pretty good chart of browser/versions, check it out here.
    • Note: JavaScript isn't the only ECMAScript implementation, and JavaScript (the standard maintained by Mozilla) and JavaScript the language (more general, sometimes inaccurately used, term) are not the same thing, for example IE's implementation is called JScript.
  2. Not that I've ever seen in anything practical/widespread...you'd have to be doing something pretty specific/specialized for it to have any merit, imo.
  1. 维基百科有一个很好的浏览器/版本图表,请在此处查看
    • 注意:JavaScript 并不是唯一的 ECMAScript 实现,而且 JavaScript(Mozilla 维护的标准)和 JavaScript 语言(更笼统,有时不准确地使用,术语)不是一回事,例如 IE 的实现称为JScript
  2. 并不是说我在任何实用/广泛的东西中都见过......你必须做一些非常具体/专门的事情才能有任何优点,imo。