我收到此错误:
Uncaught SyntaxError: missing ) after argument list
这是我的 JavaScript 代码:
saveButton.addEventListener("click" function() {
const textToSave = inputTextField.value;
console.log("I am going to save " + textToSave + " to Firestore");
docRef.set({
quote: textToSave
}).then(function() {
console.log("Status saved!");
}).catch(function (error) {
console.log("Got an error: ", error);
});
});
感谢您的帮助!
最佳答案
“click”后需要一个逗号。
saveButton.addEventListener("click", function() {
...
});
关于javascript - 未捕获的语法错误 : missing ) after argument list - JavaScript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48255179/