gpstest
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Nrusingh GPS</title>
<link href="css/index.css" rel="stylesheet" />
<script src="js/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$('#txt_submit').on('click', function(){
url = "http://23.92.61.79:8082/api/session";
var email_id = $('#txt_email_id').val();
var password = $('#txt_password').val();
if(email_id == undefined || email_id.trim().length <= 0 || password == undefined || password.trim().length <= 0){
$('#div_response').html("");
$('#div_response').html("Invalid Email ID or Password");
}else{
$.ajax({
async:false,
cache:false,
dataType:"json",
type: "POST",
url: url,
async: false,
data:{email:email_id,password:password},
success: function (response) {
console.log('Success: '+JSON.stringify(response));
$('#div_response').html("");
$('#div_response').html("Login success.Please wait...");
//window.location.href = 'main.jsp';
//$(location).attr('href', 'main.jsp');
// submit the form
$('form').attr('action','login');
$('form').submit();
},
error: function (response) {
console.log('Error: '+JSON.stringify(response));
$('#div_response').html("");
$('#div_response').html("There has been an error.");
}
});
}
});
});
</script>
</head>
<body>
<div>
<div>
<table>
<tr>
<td>
</td>
<td>
<form action="IndexServlet" method="post">
<table>
<tr>
<td>eMail Id</td>
<td><div><input type="text" id="txt_email_id" name="txt_email_id" placeholder="Email Id" class="txt" /></div></td>
</tr>
<tr>
<td>Password</td>
<td><div><input type="password" id="txt_password" name="txt_password" placeholder="Password" class="txt" /></div></td>
</tr>
<tr>
<td></td>
<td><div class="box-btn"><input type="button" id="txt_submit" name="txt_submit" value="Login" class="btn" /></div></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td><a href="register">Register</a></td>
<td><div id="div_response">.</div></td>
</tr>
</table>
</div>
</div>
</body>
</html>
|
Revision |
Author |
Commited |
Message |
1
|
lingaraj
|
Sat 24 Nov, 2018 13:04:59 +0000 |
|