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

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

@@ -7,7 +7,7 @@
</div>
<p><code><strong>startsWith()</strong></code>方法用来判断当前字符串是否是以另外一个给定的子字符串“开头”的,根据判断结果返回 <code>true</code><code>false</code></p>
<h2 id="Syntax" name="Syntax">语法</h2>
<pre class="syntaxbox"><code class="brush:js;"><em>str</em>.startsWith(<em>searchString</em> [, <em>position</em>])</code>;</pre>
<pre><code class="language-javascript"><code class="brush:js;"><em>str</em>.startsWith(<em>searchString</em> [, <em>position</em>])</code>;</code></pre>
<h3 id="参数">参数</h3>
<dl>
<dt><code>searchString</code></dt>
@@ -16,13 +16,13 @@
<dd><code>str</code> 中搜索 <code><var>searchString</var></code> 的开始位置,默认值为 0也就是真正的字符串开头处。</dd>
</dl>
<h2 id="Examples" name="Examples">示例</h2>
<pre class="brush:js;">var str = "To be, or not to be, that is the question.";
<pre><code class="language-js;">var str = "To be, or not to be, that is the question.";
alert(str.startsWith("To be")); // true
alert(str.startsWith("not to be")); // false
alert(str.startsWith("not to be", 10)); // true</pre>
alert(str.startsWith("not to be", 10)); // true</code></pre>
<h2 id="Polyfill">Polyfill</h2>
<pre class="brush: js">/*! http://mths.be/startswith v0.2.0 by @mathias */
<pre><code class="language-javascript">/*! http://mths.be/startswith v0.2.0 by @mathias */
if (!String.prototype.startsWith) {
(function() {
'use strict'; // needed to support `apply`/`call` with `undefined`/`null`
@@ -76,7 +76,7 @@ if (!String.prototype.startsWith) {
String.prototype.startsWith = startsWith;
}
}());
}</pre>
}</code></pre>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
<div><div class="blockIndicator warning"><strong><a class="external" href="https://github.com/mdn/browser-compat-data" rel="noopener">We're converting our compatibility data into a machine-readable JSON format</a></strong>.
This compatibility table still uses the old format,