forked from ANKAN-MUKHOPADHYAY/JavaScript_QUIZ
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
Latest commit
114 lines (94 loc) · 2.95 KB
/
Copy pathindex.html
File metadata and controls
114 lines (94 loc) · 2.95 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html>
<head>
<title></title>
<linkrel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<scriptsrc="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<scripttype="text/javascript">
functionsubmitdata(){
varnewUser=newObject();
newUser.username=document.getElementById('User').value;
newUser.phonenumber=document.getElementById('number').value;
console.log(newUser);
vary=newXMLHttpRequest();
y.onreadystatechange=function(){
if(this.readyState==4){
vardata=JSON.parse(this.responseText)
console.log(data);
document.getElementById('User').value=data.username;
document.getElementById('number').value=data.phonenumber;
if(data.success){
//Need to add sessioStorage.setItem Here
sessionStorage.setItem('LoggedInUser',data.Users.UID);
window.location.href="ideology.html";
}
}
};
//y.open('POST', 'http://192.168.1.2:7000/ideology/register', true);
y.open('GET','data/login.json',true);
y.setRequestHeader("Content-Type","application/json");
//y.send(JSON.stringify(newUser));
y.send();
}
</script>
<styletype="text/css">
.card {
background:#ddd;
border-radius:5px;
padding:18px20px18px20px;
margin: auto;
width:30%;
box-shadow:-1px0px10pxrgba(0,0,0,0.12);
height:300px;
}
@mediaonly screen and (max-width:500px){
.card {
background:#ddd;
border-radius:5px;
padding:50px50px50px50px;
margin: auto;
width:80%;
box-shadow:-1px0px10pxrgba(0,0,0,0.12);
height:500px;
font-size:25px;
}
.form-control {
height:56px;
}
.btn {
padding:12px12px;
font-size:24px;
margin:20px;
}
}
.title {
text-align: center;
}
.btn{
float: right;
}
body{
margin:10% auto;
}
</style>
</head>
<body>
<divclass="container">
<divclass="card">
<h1class="title">Register</h1>
<divclass="form-group">
<label>Username</label>
<inputtype="type" id="User" class="form-control" required="required" />
</div>
<divclass="form-group">
<label>Mobile</label>
<inputtype="Number" id="number" class="form-control" required="required" />
</div>
<divclass="form-group">
<buttonclass="btn btn-success" onclick="submitdata()">Let's GO <spanclass="glyphicon glyphicon-log-in"></span></button>
</div>
</div>
</div>
</body>
</html>