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

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

@@ -4,15 +4,15 @@
<div><iframe class="interactive interactive-js" frameborder="0" height="250" src="https://interactive-examples.mdn.mozilla.net/pages/js/date-toisostring.html" width="100%"></iframe></div>
<p class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a class="external" href="https://github.com/mdn/interactive-examples" rel="noopener">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p>
<h2 id="Syntax" name="Syntax">语法</h2>
<pre class="syntaxbox"><var>dateObj</var>.toISOString()</pre>
<pre><code class="language-javascript"><var>dateObj</var>.toISOString()</code></pre>
<h2 id="例子">例子</h2>
<pre class="brush: js">var today = new Date("05 October 2011 14:48 UTC");
<pre><code class="language-javascript">var today = new Date("05 October 2011 14:48 UTC");
alert(today.toISOString()); // 返回2011-10-05T14:48:00.000Z
</pre>
</code></pre>
<p>上例使用了非标准字符串的解析该字符串在某些旧的浏览器如IE中可能无法被正确解析。</p>
<h2 id="Description" name="Description">Polyfill</h2>
<p>该方法在ECMA-262第5版中被标准化。对于那些不支持此方法的JS引擎可以通过加上下面的代码实现</p>
<pre class="brush:js">if ( !Date.prototype.toISOString ) {
<pre><code class="language-js">if ( !Date.prototype.toISOString ) {
( function() {
function pad(number) {
@@ -34,7 +34,7 @@ alert(today.toISOString()); // 返回2011-10-05T14:48:00.000Z
};
}() );
}</pre>
}</code></pre>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>