login.html 865 B

1234567891011121314151617181920212223242526272829303132
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Login</title>
  5. <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
  6. </script>
  7. </head>
  8. <body>
  9. <h1>Admin Login</h1>
  10. <p>Please enter your password here</p>
  11. <input id="password" type="password">
  12. <button onclick="handleLogin()">Login</button>
  13. <script>
  14. function handleLogin() {
  15. var password = $("#password").val();
  16. $.ajax({
  17. url: "/login",
  18. data: {password: password},
  19. success: function(value){
  20. if (value == true){
  21. alert("You have logged in");
  22. }else{
  23. alert("Incorrect Password");
  24. }
  25. }
  26. });
  27. }
  28. </script>
  29. </body>
  30. </html>