1
I am unable to pull login data from the form HTML
, I need those values to go into the code JavaScript
, I already have the user on database
and also the APIs Keys
, I was able to create the user with an example of parse’s own documentation and now I’m trying to log in for testing, but without success.
Note: I removed the Keys from the code
Just follow my code:
<!doctype html>
<head>
<meta charset="utf-8">
<title>My Parse App</title>
<meta name="description" content="My Parse App">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/styles.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://www.parsecdn.com/js/parse-1.4.2.min.js"></script>
</head>
<body>
<div id="main">
<h1>Login</h1>
<p>Login do usuario</p>
<form id="login">
User name:<br>
<input type="text" id="username" name="username">
<br>
User password:<br>
<input type="password" id="password" name="password">
<input type="submit" value="Enviar">
</form>
<script type="text/javascript">
Parse.initialize("", "");
Parse.User.logIn("#username", "#password", {
success: function(user) {
// Do stuff after successful login.
alert("Sucesso: ");
},
error: function(user, error) {
// The login failed. Check error to see why.
alert("Error: " + error.code + " " + error.message);
}
});
</script>
</body>
</html>
I’ve been reading Parse’s documentation and it seems that you need to create an object to receive these values, it proceeds?
Hugs!