2015-11-16 33 views
1

我試圖使用解析創建登錄,但是當我嘗試點擊提交按鈕時,沒有響應。我不知道接下來應該做什麼。混淆的根源在「註冊形式」之下。感謝您給予的任何幫助。此外,我使用網站應用程序的解析部分。使用解析註冊將無法使用。未知錯誤

<!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="[email protected]" /> 
     </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 protected]"); 
*/ 

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

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

回答

1

由於從parse documentation,你可能會丟失註冊後設定

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); 
    } 
});