Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/433.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我无法在我的javascript项目中的firebase auth中创建用户。我该怎么办?_Javascript_Html_Firebase_Dom_Firebase Authentication - Fatal编程技术网

我无法在我的javascript项目中的firebase auth中创建用户。我该怎么办?

我无法在我的javascript项目中的firebase auth中创建用户。我该怎么办?,javascript,html,firebase,dom,firebase-authentication,Javascript,Html,Firebase,Dom,Firebase Authentication,我正在尝试使用firebase创建登录/注册表单,但无法创建新用户。这是我的 HTML: 我不明白为什么它不能正常工作。它以前工作得很好,但现在出现了问题。 将显示警报,但不会创建新用户。 请帮帮我。 多谢各位 <!DOCTYPE html> <html lang="en"> <head> <!-- bootstrap css --> <link rel="stylesheet" hr

我正在尝试使用firebase创建登录/注册表单,但无法创建新用户。这是我的 HTML:

我不明白为什么它不能正常工作。它以前工作得很好,但现在出现了问题。 将显示警报,但不会创建新用户。 请帮帮我。 多谢各位

<!DOCTYPE html>
<html lang="en">
<head>
    <!-- bootstrap css  -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <!-- material design css -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SignUp</title>
    <link rel="stylesheet" href="common.css">
    <link rel="stylesheet" href="aman-up.css">
</head>
<body>
    <header class="header">
        <div id="head_div">
            <label id="app_name">Gossips</label>
            <label id="signin" class="link_types"><a class="link" href="aman-in.html">SignIn</a></label>
            <label id="signin" class="link_types"><a class="link" href="aman.html">Home</a></label>

        </div>
    </header>
    <form class="inputs" id="input">
       <div id="progress_bar">
            <!-- MDL Progress Bar with Indeterminate Progress -->
           <div id="p2" class="mdl-progress mdl-js-progress mdl-progress__indeterminate"></div>
       </div>
        <div class="form-group">
          <label for="exampleInputEmail1">Email address</label>
          <input type="email" class="form-control" id="email_up_txt" aria-describedby="emailHelp">
          <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
        </div>
        <div class="form-group">
          <label for="exampleInputPassword1">Password</label>
          <input type="password" class="form-control" id="pass_up_txt">
        </div>
        <div class="form-group">
            <label for="exampleInputPassword1">Confirm Password</label>
            <input type="password" class="form-control" id="conf_txt">
          </div>
        <button class="btn btn-primary" id="signup_btn">Sign-Up</button>
      </form>
      <script src="https://www.gstatic.com/firebasejs/7.18.0/firebase-app.js"></script>
      <script src="https://www.gstatic.com/firebasejs/7.18.0/firebase-auth.js"></script>
      <script src="aman.js"></script>
</body>
</html>
var firebaseConfig = {
  apiKey: "AIzaSyAQv6yaB_E07ZeYMwZBUCer4R58AUjQB3I",
  authDomain: "fir-web-app-edc31.firebaseapp.com",
  databaseURL: "https://fir-web-app-edc31.firebaseio.com",
  projectId: "fir-web-app-edc31",
  storageBucket: "fir-web-app-edc31.appspot.com",
  messagingSenderId: "956021574925",
  appId: "1:956021574925:web:6f3a4e217980d9dd22b444"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);

document.getElementById("signup_btn").onclick=function(){
  var email=document.getElementById("email_up_txt").value;
  var password=document.getElementById("pass_up_txt").value;
  firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {
    // Handle Errors here.
    var errorCode = error.code;
    var errorMessage = error.message;
    // ...
    alert(errorMessage);
  });
  alert(email);
}