keep working on the like button
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
<title>posts</title>
|
||||
<link rel="stylesheet" type="text/css" href="/style.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<script src="/script.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="postbox">
|
||||
|
||||
15
client/script.js
Normal file
15
client/script.js
Normal file
@@ -0,0 +1,15 @@
|
||||
function like(id) {
|
||||
|
||||
const usernameBox = document.getElementById('username');
|
||||
const passwordBox = document.getElementById('password');
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('username', usernameBox.value);
|
||||
formData.append('password', passwordBox.value);
|
||||
formData.append('post', id);
|
||||
|
||||
fetch('/like', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
});
|
||||
}
|
||||
@@ -55,6 +55,11 @@ img {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.post-buttons {
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
input, textarea, button {
|
||||
font-size: 16px;
|
||||
|
||||
Reference in New Issue
Block a user