-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
23 lines (18 loc) · 647 Bytes
/
main.js
File metadata and controls
23 lines (18 loc) · 647 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
async function readInput(){
var userName = document.getElementById("userName").value;
var passWord = document.getElementById("passWord").value;
const Http = new XMLHttpRequest();
const url="http://localhost:8081/api/login/create/?userName=" + userName + "&passWord=" + passWord;
Http.open("GET", url);
Http.send();
const response = await fetch(url);
const data = await response.json();
var json = JSON.stringify(data);
document.getElementById("demo").innerHTML = json;
if (json == 'false') {
window.alert("incorrect password");
}
else {
location.replace("rahimian.io")
}
}