forked from ParksAaron/scoot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnewPost.html
More file actions
57 lines (41 loc) · 1.3 KB
/
Copy pathnewPost.html
File metadata and controls
57 lines (41 loc) · 1.3 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
<!DOCTYPE html>
<html>
<head>
<title>Scoot</title>
<link rel="stylesheet" type="text/css" href="styles/style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<header>
<div class="top">
<img src="images/scoot.png" id="logo">
</div>
</header>
<div class="center">
<h3>Create New Post</h3>
<form method="POST" class="login">
<input type="text" name="post" id ="post" placeholder="Scoot Scoot"></input>
<button type="button" id="postBtn">Post</button>
</form>
</div>
</body>
</html>
<script>
$("#postBtn").click(savePost);
function savePost() {
$.ajax({
type: "POST",
url: "savePost.php",
contentType: "application/json",
data: JSON.stringify({
"post": $("#post").val()
}),
success: function(data,status) {
console.log(status);
},
error: function() {
console.log("error", arguments);
}
});
}
</script>