未捕获的SyntaxError:意外的令牌,位于firebase中的refCreateUser

问题描述:

我在控制台中看到以下错误。我不知道我怎样才能在ref.CreateUser未捕获的SyntaxError:意外的令牌,位于firebase中的refCreateUser

未捕获的SyntaxError提供电子邮件和密码:意外的令牌,

这是功能

function so_passwd() { 
    var email = $("#so_email").val(); 
    var password = $("#so_pass").val(); 
    ref.createUser({ 
    email, 
    password 
    }, function(error) { 
    if (error === null) { 
     console.log("User created successfully"); 
    } else { 
     console.log("Error creating user:", error); 
    } 
    }); 
} 
+1

那么,这是无效的JSON。 – Daedalus 2014-10-04 23:10:37

它不应该是:

function so_passwd(){ 
    var email = $("#so_email").val(); 
    var password = $("#so_pass").val(); 
    ref.createUser({ 
     "email": email 
     "password": password 
    }, function(error) { 
    if (error === null) { 
     console.log("User created successfully"); 
    } else { 
     console.log("Error creating user:", error); 
    } 
}); 
+0

谢谢,解决了这个问题。 – thezohaan 2014-10-04 23:36:01