質問編集履歴
3
エラー
test
CHANGED
File without changes
|
test
CHANGED
@@ -138,6 +138,16 @@
|
|
138
138
|
|
139
139
|
|
140
140
|
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
button.js:6 Uncaught TypeError: btn.addEventListener is not a function
|
146
|
+
|
147
|
+
at ./app/javascript/button.js.window.onload (button.js:6)
|
148
|
+
|
149
|
+
エラー
|
150
|
+
|
141
151
|
```
|
142
152
|
|
143
153
|
|
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -120,9 +120,11 @@
|
|
120
120
|
|
121
121
|
|
122
122
|
|
123
|
+
window.onload = function(){
|
123
124
|
|
124
125
|
|
126
|
+
|
125
|
-
const btn = document.getElementByI
|
127
|
+
const btn = document.getElementById("button-javascript");
|
126
128
|
|
127
129
|
|
128
130
|
|
@@ -131,6 +133,10 @@
|
|
131
133
|
console.log("削除しますか?");
|
132
134
|
|
133
135
|
});
|
136
|
+
|
137
|
+
}
|
138
|
+
|
139
|
+
|
134
140
|
|
135
141
|
```
|
136
142
|
|
1
エラー分追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -140,6 +140,8 @@
|
|
140
140
|
|
141
141
|
|
142
142
|
|
143
|
+
|
144
|
+
|
143
145
|
```
|
144
146
|
|
145
147
|
show.html.erb
|
@@ -163,3 +165,25 @@
|
|
163
165
|
|
164
166
|
|
165
167
|
```
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
エラー
|
174
|
+
|
175
|
+
```
|
176
|
+
|
177
|
+
bootstrap:83 Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js):
|
178
|
+
|
179
|
+
SyntaxError: /Users/user/projects/Books/app/javascript/button.js: Unexpected token, expected "," (9:1)
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
7 | console.log("削除しますか?");
|
184
|
+
|
185
|
+
8 | });
|
186
|
+
|
187
|
+
> 9 | }
|
188
|
+
|
189
|
+
```
|