简体   繁体   English

使用parse进行注册将不起作用。 未知错误

[英]Sign up with parse will not work. Unknown error

I have attempted to create a sign in using parse but when I attemp to hit the submit button, there is no response. 我试图使用解析创建登录,但是当我尝试按下“提交”按钮时,没有任何响应。 I do not know what I should do next. 我不知道下一步该怎么做。 The source of confusion is under "register-form". 混乱的根源在“注册表”下。 Thanks for any help you give. 感谢您的帮助。 Also I used the web app section of parse for my site. 另外,我在网站上使用了解析的Web应用程序部分。

   <!DOCTYPE html>
<html>
<head>
    <link type="text/css" rel="stylesheet" href="stylesheet.css">
    <script src="bower_components/jquery/dist/jquery.js" charset="utf-8"></script>
    <script src="bower_components/parse/parse.js"> </script>
<script> Parse.initialize("9gnbNsFoQShUFWP0dp96S771Y2oxxuRd8gDdcfe9", "sgBmpwSykCv2Z9qALJj8KgEMP34ILuEFhLRJWkau"); </script>


    <!-- Include Parse! -->
</head>

<body>
    <div class="nav">
        <div class="container">
            <ul>
                <a href="page3.html">Schedule</a>
                <a href="page2.html">Forums</a>
                <a href="page4.html">Sign Up</a>
                <a href="page5.html">Log In</a>
                <a href="index.html">Home</a>
            </ul>
            <div class="heading">
                <center>
                    <h1> 
    <center><img src="https://upload.wikimedia.org/wikipedia/en/thumb/3/30/Winchester_Thurston_School_Logo.svg/220px-Winchester_Thurston_School_Logo.svg.png" 
    alt="Smiley face" style="float:left;width:42px;height:42px;"></center>

    Winchester Thurston </h1></center>
            </div>
        </div>

    </div>
    </div>
    <div class="right">
        <p> News will go here </p>
    </div>

    <form id="register-form" autocomplete="on">
        <h1> Sign up </h1>

        <p>
            <label for="usernamesignup" class="uname" data-icon="u">Username(School Appropriate):</label>
            <input id="usernamesignup" name="usernamesignup" required="required" type="text" placeholder="Username" />
        </p>
        <p>
            <label for="passwordsignup" class="youpasswd" data-icon="p">Password:</label>
            <input id="passwordsignup" name="passwordsignup" required="required" type="password" placeholder="Password" />
        </p>

        <p>
            <label for="emailsignup" class="youmail" data-icon="e">Email(Use WT emal):</label>
            <input id="emailsignup" name="emailsignup" required="required" type="email" placeholder="example@domain.com" />
        </p>

                       <p class="signin button">
            <input class="register-submit" type="submit" value="Register" />
            <script>
                $(function() {
                    var registerForm = $('#register-form');
                    registerForm.on('submit', function(ev) {
                        ev.preventDefault();

                        // Pull fields from the form.

                        window.form = registerForm;

                        // Do parse stuff.
                        var user = new Parse.User();
                        user.set("username", registerForm.find('#usernamesignup').val());
                        user.set("password", registerForm.find('#passwordsignup').val());
                        user.set("email", registerForm.find('#emailsignup').val());
/*          
                        user.set("password", "my pass");
                        user.set("email", "email@example.com");
*/

                        // FINISH IT.
                    });
                });
            </script>
        </p>
    </form>
    </div>
    </div>

    <div class="footer">
        I made this and don't steal it
    </div>
</body>
</html>

As from Parse documentation , you might be missing signUp after set 从解析文档开始 ,设置后您可能会缺少signUp

user.set("username", registerForm.find('#usernamesignup').val());
user.set("password", registerForm.find('#passwordsignup').val());
user.set("email", registerForm.find('#emailsignup').val());

user.signUp(null, {
  success: function(user) {
    // Hooray! Let them use the app now.
  },
  error: function(user, error) {
    // Show the error message somewhere and let the user try again.
    alert("Error: " + error.code + " " + error.message);
  }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM