语法高亮,滚动条美化,设置页面调整

This commit is contained in:
fofolee
2019-04-19 02:41:09 +08:00
parent 1e8f76c000
commit 359d29ee0b
1590 changed files with 12328 additions and 11441 deletions

View File

@@ -1,8 +1,8 @@
<article id="wikiArticle">
<div></div>
<h2 id="信息">信息</h2>
<pre class="syntaxbox">SyntaxError: unterminated string literal
</pre>
<pre><code class="language-javascript">SyntaxError: unterminated string literal
</code></pre>
<h2 id="错误类型">错误类型</h2>
<p><a href="Reference/Global_Objects/SyntaxError" title="SyntaxError 对象代表尝试解析语法上不合法的代码的错误。"><code>SyntaxError</code></a> </p>
<h2 id="哪里出错了?">哪里出错了?</h2>
@@ -15,24 +15,24 @@
<h2 id="示例">示例</h2>
<h3 id="多行字符串">多行字符串</h3>
<p>在javascript中你不能够直接使用多行字符串赋值给一个变量。如下</p>
<pre class="brush: js example-bad">var longString = "This is a very long string which needs
<pre><code class="language-js example-bad">var longString = "This is a very long string which needs
to wrap across multiple lines because
otherwise my code is unreadable.";
// SyntaxError: unterminated string literal</pre>
// SyntaxError: unterminated string literal</code></pre>
<p>可以使用<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Addition">"+"运算符</a>,反斜杠,或<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals">模板字符串</a>来代替多行。“+”运算符的使用如下:</p>
<pre class="brush: js example-good">var longString = "This is a very long string which needs " +
<pre><code class="language-js example-good">var longString = "This is a very long string which needs " +
"to wrap across multiple lines because " +
"otherwise my code is unreadable.";
</pre>
</code></pre>
<p>或者你可以使用“\”在每一行的末尾,以表示该字符串在下一行继续。要确保“\“之后没有没有空格和任何其他的字符,及缩进,否则该“\”将不会起作用。使用方法如下:</p>
<pre class="brush: js example-good">var longString = "This is a very long string which needs \
<pre><code class="language-js example-good">var longString = "This is a very long string which needs \
to wrap across multiple lines because \
otherwise my code is unreadable.";
</pre>
</code></pre>
<p>另一种方式是使用 ES 2015 的环境所支持<a class="new" href="Reference/Template_literals" rel="nofollow">模板字符串</a>(反引号` `)。</p>
<pre class="brush: js example-good">var longString = `This is a very long string which needs
<pre><code class="language-js example-good">var longString = `This is a very long string which needs
to wrap across multiple lines because
otherwise my code is unreadable.`;</pre>
otherwise my code is unreadable.`;</code></pre>
<h2 id="相关">相关</h2>
<ul>
<li><a href="Reference/String" title="此页面仍未被本地化, 期待您的翻译!"><code>String</code></a> </li>