回答編集履歴

2

this統一

2016/03/14 18:40

投稿

mpyw
mpyw

スコア5223

test CHANGED
@@ -118,7 +118,7 @@
118
118
 
119
119
  xhr.onreadystatechange = function () {
120
120
 
121
- if (xhr.status === 200 && this.readyState === 3) {
121
+ if (this.status === 200 && this.readyState === 3) {
122
122
 
123
123
  // chunkの一部分が返ってきたときテキストエリアを更新
124
124
 
@@ -128,7 +128,7 @@
128
128
 
129
129
  }
130
130
 
131
- if (xhr.status === 200 && this.readyState === 4) {
131
+ if (this.status === 200 && this.readyState === 4) {
132
132
 
133
133
  // 終了時
134
134
 
@@ -138,7 +138,7 @@
138
138
 
139
139
  }
140
140
 
141
- if (xhr.status !== 200 && this.readyState === 4) {
141
+ if (this.status !== 200 && this.readyState === 4) {
142
142
 
143
143
  // エラー時
144
144
 

1

補足

2016/03/14 18:40

投稿

mpyw
mpyw

スコア5223

test CHANGED
@@ -172,6 +172,8 @@
172
172
 
173
173
 
174
174
 
175
- 一応実装例があるのでこちらに貼っておきます
175
+ **Apacheとか`php -S`に頼らず全てWebサーバまでPHPで実装した**例があるのでこちらに貼っておきます
176
+
177
+ (あんまり参考にならないかも)
176
178
 
177
179
  [https://github.com/mpyw/http-tutorial-with-php](https://github.com/mpyw/http-tutorial-with-php)