mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2026-02-27 09:32:01 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<h3 id=".E4.BD.BF.E7.94.A8_JavaScript_1.8" name=".E4.BD.BF.E7.94.A8_JavaScript_1.8">使用 JavaScript 1.8</h3>
|
||||
<p>为了可以在 HTML 中使用 JavaScript 1.8 的新特性,需要这样写:</p>
|
||||
<pre class="eval"> <script type="application/javascript;version=1.8"> ... 你的代码 ... </script>
|
||||
</pre>
|
||||
</code></pre>
|
||||
<p>另一种方法(不推荐)是使用旧式的 <script> 属性 language,把它定义为 "JavaScript1.8"。</p>
|
||||
<p>在使用 <a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Projects/SpiderMonkey/Introduction_to_the_JavaScript_shell" title="Cn/Introduction_to_the_JavaScript_shell">JavaScript shell</a> 、JavaScript XPCOM 组件,或者 XUL <code><script></code> 元素的时候,将自动启用最新的JS版本(Mozilla 1.9中的 JS1.8)(<a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=381031" rel="noopener" title="FIXED: make JS1.8 the default for <xul:script>">bug 381031</a>, <a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=385159" rel="noopener" title="FIXED: Make the JS shell use the latest version">bug 385159</a>)。</p>
|
||||
<p>如果需要使用新的关键字 "yield" 和 "let",你需要指定是1.7版本或者更高的版本,因为现有的代码可能会把这两个关键字用作变量名或者函数名。如果要使用的新特性没有引入任何新的关键字(例如生成器表达式),就可以不指定 JavaScript 的版本。</p>
|
||||
|
||||
Reference in New Issue
Block a user