Skip to content

Commit

Permalink
Site updated: 2019-05-24 22:21:05
Browse files Browse the repository at this point in the history
  • Loading branch information
xxplus committed May 24, 2019
1 parent 74b3ea0 commit 318c2b6
Show file tree
Hide file tree
Showing 24 changed files with 236 additions and 235 deletions.
4 changes: 2 additions & 2 deletions 2019/05/22/2 字符串/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ <h1 id="Base64-转码"><a href="#Base64-转码" class="headerlink" title="Base64

<nav id="article-nav">

<a href="/2019/05/22/Call与Apply/" id="article-nav-newer" class="article-nav-link-wrap">
<a href="/2019/05/22/9 JavaScript Classes/" id="article-nav-newer" class="article-nav-link-wrap">
<i class="icon-circle-left"></i>
<div class="article-nav-title">

ECMA5 CALL APPLY 模拟
ECMA6 类

</div>
</a>
Expand Down
8 changes: 4 additions & 4 deletions 2019/05/22/3 对象/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,18 +250,18 @@ <h1 id="遍历总结"><a href="#遍历总结" class="headerlink" title="遍历

<nav id="article-nav">

<a href="/2019/05/22/关于 this 指针/" id="article-nav-newer" class="article-nav-link-wrap">
<a href="/2019/05/22/5 标准库/" id="article-nav-newer" class="article-nav-link-wrap">
<i class="icon-circle-left"></i>
<div class="article-nav-title">

ECMA5 this指针
ECMA5 标准库

</div>
</a>


<a href="/2019/05/22/9 JavaScript Classes/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA6 类</div>
<a href="/2019/05/22/4 函数/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 函数</div>
<i class="icon-circle-right"></i>
</a>

Expand Down
8 changes: 4 additions & 4 deletions 2019/05/22/4 函数/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,18 @@ <h1 id="6-立即调用的函数表达式-IIFE"><a href="#6-立即调用的函数

<nav id="article-nav">

<a href="/2019/05/22/9 面向对象编程/" id="article-nav-newer" class="article-nav-link-wrap">
<a href="/2019/05/22/3 对象/" id="article-nav-newer" class="article-nav-link-wrap">
<i class="icon-circle-left"></i>
<div class="article-nav-title">

ECMA5 面向对象编程
ECMA5 对象

</div>
</a>


<a href="/2019/05/22/5 标准库/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 标准库</div>
<a href="/2019/05/22/6 Array/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 数组</div>
<i class="icon-circle-right"></i>
</a>

Expand Down
8 changes: 4 additions & 4 deletions 2019/05/22/5 标准库/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,18 +239,18 @@ <h1 id="6-控制对象的状态"><a href="#6-控制对象的状态" class="heade

<nav id="article-nav">

<a href="/2019/05/22/4 函数/" id="article-nav-newer" class="article-nav-link-wrap">
<a href="/2019/05/22/7 包装对象 wrapper/" id="article-nav-newer" class="article-nav-link-wrap">
<i class="icon-circle-left"></i>
<div class="article-nav-title">

ECMA5 函数
ECMA5 包装对象

</div>
</a>


<a href="/2019/05/22/7 包装对象 wrapper/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 包装对象</div>
<a href="/2019/05/22/3 对象/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 对象</div>
<i class="icon-circle-right"></i>
</a>

Expand Down
8 changes: 4 additions & 4 deletions 2019/05/22/6 Array/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,18 +250,18 @@ <h1 id="2-实例方法"><a href="#2-实例方法" class="headerlink" title="2

<nav id="article-nav">

<a href="/2019/05/22/继承/" id="article-nav-newer" class="article-nav-link-wrap">
<a href="/2019/05/22/4 函数/" id="article-nav-newer" class="article-nav-link-wrap">
<i class="icon-circle-left"></i>
<div class="article-nav-title">

ECMA5 继承
ECMA5 函数

</div>
</a>


<a href="/2019/05/22/9 面向对象编程/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 面向对象编程</div>
<a href="/2019/05/22/关于 this 指针/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 this指针</div>
<i class="icon-circle-right"></i>
</a>

Expand Down
8 changes: 4 additions & 4 deletions 2019/05/22/7 包装对象 wrapper/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -256,18 +256,18 @@ <h3 id="3-4-字符串的实例方法"><a href="#3-4-字符串的实例方法" cl

<nav id="article-nav">

<a href="/2019/05/22/5 标准库/" id="article-nav-newer" class="article-nav-link-wrap">
<a href="/2019/05/22/继承/" id="article-nav-newer" class="article-nav-link-wrap">
<i class="icon-circle-left"></i>
<div class="article-nav-title">

ECMA5 标准库
ECMA5 继承

</div>
</a>


<a href="/2019/05/22/关于 this 指针/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 this指针</div>
<a href="/2019/05/22/5 标准库/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 标准库</div>
<i class="icon-circle-right"></i>
</a>

Expand Down
8 changes: 4 additions & 4 deletions 2019/05/22/9 JavaScript Classes/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -236,18 +236,18 @@ <h1 id="Questions"><a href="#Questions" class="headerlink" title="Questions"></a

<nav id="article-nav">

<a href="/2019/05/22/3 对象/" id="article-nav-newer" class="article-nav-link-wrap">
<a href="/2019/05/22/Call与Apply/" id="article-nav-newer" class="article-nav-link-wrap">
<i class="icon-circle-left"></i>
<div class="article-nav-title">

ECMA5 对象
ECMA5 CALL APPLY 模拟

</div>
</a>


<a href="/2019/05/22/Call与Apply/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 CALL APPLY 模拟</div>
<a href="/2019/05/22/2 字符串/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 字符串</div>
<i class="icon-circle-right"></i>
</a>

Expand Down
8 changes: 4 additions & 4 deletions 2019/05/22/9 面向对象编程/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -277,18 +277,18 @@ <h1 id="跳-对象的相关方法"><a href="#跳-对象的相关方法" class="h

<nav id="article-nav">

<a href="/2019/05/22/6 Array/" id="article-nav-newer" class="article-nav-link-wrap">
<a href="/2019/05/22/关于 this 指针/" id="article-nav-newer" class="article-nav-link-wrap">
<i class="icon-circle-left"></i>
<div class="article-nav-title">

ECMA5 数组
ECMA5 this指针

</div>
</a>


<a href="/2019/05/22/4 函数/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 函数</div>
<a href="/2019/05/22/Call与Apply/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 CALL APPLY 模拟</div>
<i class="icon-circle-right"></i>
</a>

Expand Down
8 changes: 4 additions & 4 deletions 2019/05/22/Call与Apply/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,18 +234,18 @@ <h1 id="参考文献"><a href="#参考文献" class="headerlink" title="参考

<nav id="article-nav">

<a href="/2019/05/22/9 JavaScript Classes/" id="article-nav-newer" class="article-nav-link-wrap">
<a href="/2019/05/22/9 面向对象编程/" id="article-nav-newer" class="article-nav-link-wrap">
<i class="icon-circle-left"></i>
<div class="article-nav-title">

ECMA6 类
ECMA5 面向对象编程

</div>
</a>


<a href="/2019/05/22/2 字符串/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 字符串</div>
<a href="/2019/05/22/9 JavaScript Classes/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA6 类</div>
<i class="icon-circle-right"></i>
</a>

Expand Down
8 changes: 4 additions & 4 deletions 2019/05/22/关于 this 指针/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,18 +218,18 @@ <h1 id="1-概念"><a href="#1-概念" class="headerlink" title="1 概念"></a>1

<nav id="article-nav">

<a href="/2019/05/22/7 包装对象 wrapper/" id="article-nav-newer" class="article-nav-link-wrap">
<a href="/2019/05/22/6 Array/" id="article-nav-newer" class="article-nav-link-wrap">
<i class="icon-circle-left"></i>
<div class="article-nav-title">

ECMA5 包装对象
ECMA5 数组

</div>
</a>


<a href="/2019/05/22/3 对象/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 对象</div>
<a href="/2019/05/22/9 面向对象编程/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 面向对象编程</div>
<i class="icon-circle-right"></i>
</a>

Expand Down
4 changes: 2 additions & 2 deletions 2019/05/22/继承/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ <h4 id="2-5-寄生组合继承"><a href="#2-5-寄生组合继承" class="headerl
</a>


<a href="/2019/05/22/6 Array/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 数组</div>
<a href="/2019/05/22/7 包装对象 wrapper/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">ECMA5 包装对象</div>
<i class="icon-circle-right"></i>
</a>

Expand Down
39 changes: 20 additions & 19 deletions 2019/05/24/10 Ajax/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<meta property="og:site_name" content="chochi&#39;s workshop">
<meta property="og:description" content="Ajax1 基础个人demo地址 1.1 概念 作用 Read data from a web server - after the page has loaded Update a web page without reloading the page Send data to a web server - in the background AJAX allows web pages to b">
<meta property="og:locale" content="default">
<meta property="og:updated_time" content="2019-05-24T14:15:58.373Z">
<meta property="og:updated_time" content="2019-05-24T14:20:39.462Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="ECMA5 AJAX">
<meta name="twitter:description" content="Ajax1 基础个人demo地址 1.1 概念 作用 Read data from a web server - after the page has loaded Update a web page without reloading the page Send data to a web server - in the background AJAX allows web pages to b">
Expand Down Expand Up @@ -253,31 +253,32 @@ <h4 id="1-2-3-XMLHttpRequest-Object-Properties"><a href="#1-2-3-XMLHttpRequest-O
</table>
<h4 id="1-2-4-编码模板"><a href="#1-2-4-编码模板" class="headerlink" title="1.2.4 编码模板"></a>1.2.4 编码模板</h4><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span>( myRequset.readyState === <span class="number">4</span>)&#123;</span><br><span class="line"> <span class="keyword">if</span> ( (myRequest.status &gt;= <span class="number">200</span> &amp;&amp; myRquest.status&lt;<span class="number">300</span>)|| myRequst.status == <span class="number">304</span> )&#123;</span><br><span class="line"> <span class="comment">//successful or use local version</span></span><br><span class="line"> &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<hr>
<h2 id="2-请求"><a href="#2-请求" class="headerlink" title="2 请求"></a>2 请求</h2><h4 id="2-1-URL-格式"><a href="#2-1-URL-格式" class="headerlink" title="2.1 URL 格式"></a>2.1 URL 格式</h4><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">"name=value&amp;anothername="+encodeURIComponent(myVar)+"&amp;so=on"</span><br></pre></td></tr></table></figure>
<p>:question: get、post,适用场景与异同</p>
<ol>
<h2 id="2-请求"><a href="#2-请求" class="headerlink" title="2 请求"></a>2 请求</h2><h4 id="2-1-URL-格式"><a href="#2-1-URL-格式" class="headerlink" title="2.1 URL 格式"></a>2.1 URL 格式</h4><figure class="highlight jsx"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">"name=value&amp;anothername="</span>+<span class="built_in">encodeURIComponent</span>(myVar)+<span class="string">"&amp;so=on"</span></span><br></pre></td></tr></table></figure>
<h4 id="2-2-get、post,适用场景与异同"><a href="#2-2-get、post,适用场景与异同" class="headerlink" title="2.2 get、post,适用场景与异同"></a>2.2 get、post,适用场景与异同</h4><ol>
<li><p>get请求数据会负载URL之后,把数据放置在HTTP协议头中。</p>
<pre><code>- GET在浏览器回退时是无害的
- GET请求会被浏览器主动cache
- GET 请求可被收藏为书签
- 产生一个TCP数据包
- 提交的数据量限制于整个URL长度。URL长度根据不同的游览器有不同限制,IE为2083KB。
- 如果数据是英文字母/数字,原样发送,如果是空格,转换为+,如果是中文/其他字符,则直接把字符串用BASE64加密。
</code></pre></li>
</code></pre><ul>
<li>GET请求会被浏览器主动cache</li>
<li>GET 请求可被收藏为书签</li>
<li>产生一个TCP数据包</li>
<li>提交的数据量限制于整个URL长度。URL长度根据不同的游览器有不同限制,IE为2083KB。</li>
<li>如果数据是英文字母/数字,原样发送,如果是空格,转换为+,如果是中文/其他字符,则直接把字符串用BASE64加密。</li>
</ul>
</li>
<li><p>POST把提交的数据则放置在是HTTP包的包体中。</p>
<pre><code>- 游览器回退POST再次提交请求
- POST 请求不会被缓存
- POST 请求不会保留在浏览器历史记录中
- POST产生两个TCP数据包
- POST是没有大小限制的,HTTP协议规范也没有进行大小限制。起限制作用的是服务器的处理程序的处理能力。
</code></pre></li>
<li><p>POST的安全性要比GET的安全性高</p>
</code></pre><ul>
<li>POST 请求不会被缓存</li>
<li>POST 请求不会保留在浏览器历史记录中</li>
<li>POST产生两个TCP数据包</li>
<li>POST是没有大小限制的,HTTP协议规范也没有进行大小限制。起限制作用的是服务器的处理程序的处理能力。</li>
</ul>
</li>
<li><p>对于GET方式的请求,浏览器会把<code>http header</code>和<code>data</code>一并发送出去,服务器响应200(返回数据);</p>
<p>而对于POST,浏览器先发送<code>http header</code>,服务器响应100 continue,浏览器再发送<code>data</code>,服务器响应200 ok(返回数据)。</p>
<li><p>POST的安全性要比GET的安全性高</p>
</li>
<li>对于GET方式的请求,浏览器会把<code>http header</code>和<code>data</code>一并发送出去,服务器响应200(返回数据);而对于POST,浏览器先发送<code>http header</code>,服务器响应100 continue,浏览器再发送<code>data</code>,服务器响应200 ok(返回数据)。</li>
</ol>
<h2 id="关于异步操作问题"><a href="#关于异步操作问题" class="headerlink" title="关于异步操作问题"></a>关于异步操作问题</h2><h4 id="如果页面中有两个异步ajax的操作-因为不确定这两个异步操作的执行顺序,怎么在这两个操作都执行完再执行一个新的操作"><a href="#如果页面中有两个异步ajax的操作-因为不确定这两个异步操作的执行顺序,怎么在这两个操作都执行完再执行一个新的操作" class="headerlink" title="如果页面中有两个异步ajax的操作,因为不确定这两个异步操作的执行顺序,怎么在这两个操作都执行完再执行一个新的操作"></a>如果页面中有两个异步ajax的操作,因为不确定这两个异步操作的执行顺序,怎么在这两个操作都执行完再执行一个新的操作</h4><ul>
<h2 id="3-关于异步操作问题"><a href="#3-关于异步操作问题" class="headerlink" title="3 关于异步操作问题"></a>3 关于异步操作问题</h2><h4 id="Q-如果页面中有两个异步ajax的操作-因为不确定这两个异步操作的执行顺序,怎么在这两个操作都执行完再执行一个新的操作"><a href="#Q-如果页面中有两个异步ajax的操作-因为不确定这两个异步操作的执行顺序,怎么在这两个操作都执行完再执行一个新的操作" class="headerlink" title="Q: 如果页面中有两个异步ajax的操作,因为不确定这两个异步操作的执行顺序,怎么在这两个操作都执行完再执行一个新的操作"></a>Q: 如果页面中有两个异步ajax的操作,因为不确定这两个异步操作的执行顺序,怎么在这两个操作都执行完再执行一个新的操作</h4><ul>
<li>1.Promise 包装异步ajax操作,</li>
<li>2.定义async 函数,</li>
<li>3.用await等待promise数据异步获取完成</li>
Expand Down
Loading

0 comments on commit 318c2b6

Please sign in to comment.