gpt4 book ai didi

javascript - Internet Explorer 不支持 JavaScript?

转载 作者:行者123 更新时间:2023-11-29 18:16:41 24 4
gpt4 key购买 nike

我最近在阅读有关 Node.js 的文章,并得到一个关于 JavaScript 和 Internet Explorer 的有趣陈述:

Internet Explorer doesn’t actually support JavaScript or ECMAScript; it supports a language variety called JScript. In recent years, JScript has fully supported the ECMAScript 3 standard and has some ECMAScript 5 support. However, JScript also implements proprietary extensions in the same way that Mozilla JavaScript does and has features that ECMAScript does not.

Source: http://chimera.labs.oreilly.com/books/1234000001808/ch01.html#chap2_id35941400

老实说,我完全无法理解上面的说法。我知道微软有自己的 VBScript 并且它允许在 IE 中使用 JavaScript,这就是为什么 JS 比任何其他脚本语言更受欢迎的原因。这个说法是真的吗?如果是,那么 IE 的脚本引擎会将 native JavaScript 翻译成 JScript 或者其他情况是什么?

最佳答案

ECMAScript 是官方标准,JavaScript 和 JScript 是该标准的实现。就像 CPython 和 Jython 是 Python 的实现一样。

通常情况下,如果是关于浏览器,它们都不一定完全支持标准或提供额外的非标准功能,部分原因是它们在官方标准尚不存在时就开始发展。

来自 Wikipedia about JScript :

[Microsoft] did not want to deal with Sun about the trademark issue, and so they called their implementation JScript. A lot of people think that JScript and JavaScript are different but similar languages. That's not the case. They are just different names for the same language, and the reason the names are different was to get around trademark issues

来自Microsoft documentation about JScript :

JScript is the Microsoft implementation of the ECMA 262 language specification (ECMAScript Edition 3). With only a few minor exceptions (to maintain backwards compatibility), JScript is a full implementation of the ECMA standard.

关于javascript - Internet Explorer 不支持 JavaScript?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22679460/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com