mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2026-04-25 20:42:47 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<article id="wikiArticle">
|
||||
<div></div>
|
||||
<h2 id="错误提示">错误提示</h2>
|
||||
<pre class="syntaxbox">Warning: String.charAt is deprecated; use String.prototype.charAt instead
|
||||
<pre><code class="language-javascript">Warning: String.charAt is deprecated; use String.prototype.charAt instead
|
||||
Warning: String.charCodeAt is deprecated; use String.prototype.charCodeAt instead
|
||||
Warning: String.concat is deprecated; use String.prototype.concat instead
|
||||
Warning: String.contains is deprecated; use String.prototype.contains instead
|
||||
@@ -26,7 +26,7 @@ Warning: String.toUpperCase is deprecated; use String.prototype.toUpperCas
|
||||
Warning: String.trim is deprecated; use String.prototype.trim instead
|
||||
Warning: String.trimLeft is deprecated; use String.prototype.trimLeft instead
|
||||
Warning: String.trimRight is deprecated; use String.prototype.trimRight instead
|
||||
</pre>
|
||||
</code></pre>
|
||||
<h2 id="错误类型">错误类型</h2>
|
||||
<p>警告。JavaScript 引擎不会停止运行。</p>
|
||||
<h2 id="哪里出错了?">哪里出错了?</h2>
|
||||
@@ -34,15 +34,15 @@ Warning: String.trimRight is deprecated; use String.prototype.trimRight
|
||||
<p>Firefox <a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1222552" rel="noopener" title="Remove String generics">bug 1222552</a> 对 String 泛型方法的移除进行了追踪。</p>
|
||||
<h2 id="示例">示例</h2>
|
||||
<h3 id="废弃的语法">废弃的语法</h3>
|
||||
<pre class="brush: js example-bad">var num = 15;
|
||||
String.replace(num, /5/, '2');</pre>
|
||||
<pre><code class="language-js example-bad">var num = 15;
|
||||
String.replace(num, /5/, '2');</code></pre>
|
||||
<h3 id="标准语法">标准语法</h3>
|
||||
<pre class="brush: js example-good">var num = 15;
|
||||
<pre><code class="language-js example-good">var num = 15;
|
||||
String(num).replace(/5/, '2');
|
||||
</pre>
|
||||
</code></pre>
|
||||
<h2 id="垫片">垫片</h2>
|
||||
<p>以下是一个垫片脚本来为不支持 String 泛型方法浏览器提供支持:</p>
|
||||
<pre class="brush: js">/*globals define*/
|
||||
<pre><code class="language-javascript">/*globals define*/
|
||||
// Assumes all supplied String instance methods already present
|
||||
// (one may use shims for these if not available)
|
||||
(function() {
|
||||
@@ -72,7 +72,7 @@ String(num).replace(/5/, '2');
|
||||
for (i = 0; i < methodCount; i++) {
|
||||
assignStringGeneric(methods[i]);
|
||||
}
|
||||
}());</pre>
|
||||
}());</code></pre>
|
||||
<h2 id="相关内容">相关内容</h2>
|
||||
<ul>
|
||||
<li><a href="Reference/String" title="此页面仍未被本地化, 期待您的翻译!"><code>String</code></a></li>
|
||||
|
||||
Reference in New Issue
Block a user