我无法弄清楚为什么我会收到" Uncaught SyntaxError:意外的标识符"在第16行,当我从firebase复制脚本海峡时。
以下是我正在使用的内容:
<!DOCTYPE html>
<html>
<head>
<title>23 Creative</title>
<script src="https://www.gstatic.com/firebasejs/4.8.0/firebase.js"></script>
<script>
var config = {
apiKey: "XXXXXXX",
authDomain: "XXXXXXXXX",
databaseURL: "XXXXXXXXXXXX",
projectId: "XXXXXXX",
storageBucket: "XXXXXXXXXX",
messagingSenderId: "XXXXXXXXXXXX"
}
firebase.auth().createUserWithEmailAndPassword(email,
password).catch(function(,error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
// ...
});
</script>
答案 0 :(得分:1)
你忘记添加一个分号,最后添加它,如下所示:
var config = {
apiKey: "XXXXXXX",
authDomain: "XXXXXXXXX",
databaseURL: "XXXXXXXXXXXX",
projectId: "XXXXXXX",
storageBucket: "XXXXXXXXXX",
messagingSenderId: "XXXXXXXXXXXX"
};