Closed. This question is not reproducible or was caused by typos。它当前不接受答案。












想改善这个问题吗?更新问题,以便将其作为on-topic用于堆栈溢出。

3年前关闭。



Improve this question




我收到此错误:



这是我的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);
    });
});

谢谢你的帮助!

最佳答案

在“点击”之后,您需要使用逗号。

saveButton.addEventListener("click", function() {
  ...
});

07-24 09:39
查看更多