teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

コードの修正

2021/08/28 02:21

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -11,11 +11,11 @@
11
11
  よろしくお願いします。
12
12
 
13
13
  ```javascript
14
- class act = class {
14
+ class webreq = class {
15
15
  constructor( act, name, path) {
16
+ this.act = null;
16
17
  this.url = null;
17
18
  this.itemJson = null;
18
- var listVideoData = null;
19
19
  }
20
20
 
21
21
  getXhr(){
@@ -33,15 +33,15 @@
33
33
  const matches = resText.match(/var initialData = (.*?);</script>/);
34
34
  if(matches){
35
35
  resText = matches[1];
36
-            
36
+
37
-            // ↓ class変数の代入ではなさそう
37
+ // ↓ class変数の代入ではなさそう
38
38
  this.itemJson = JSON.parse(resText);
39
39
  }
40
40
 
41
-          // this.act だとエラーになるので var act で受け取り
41
+ // this.act だとエラーになるので var act で受け取り
42
- if( act ){
42
+ if( act ){
43
-           // ↓ ここでエラーになります。
43
+ // ↓ ここでエラーになります。
44
- this.setListVideoData();
44
+ this.setListVideoData();
45
45
  }
46
46
  }
47
47
  }