-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex6.html
More file actions
46 lines (39 loc) · 928 Bytes
/
index6.html
File metadata and controls
46 lines (39 loc) · 928 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<form action="" method="post">
<label>
Name:
<input type="text" name="login">
</label>
<label>
Password:
<input type="password" name="pass">
</label>
<input id="send" type="submit">
</form>
<script>
var submit = document.getElementById('send');
submit.onclick = function(e){
e.preventDefault();
var name = document.querySelector('[name="login"]'),
password = document.querySelector('[name="pass"]');
console.log(name.value);
var data = {
name: name.value,
password: pass.value
};
var request = new XMLHttpRequest();
xml.open('POST', 'https://user-maks1mp.c9users.io/', false);
xml.send(JSON.stringify(data));
};
var xml = new XMLHttpRequest();
xml.open('GET', 'https://user-maks1mp.c9users.io/', false);
xml.send();
</script>
</body>
</html>