<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>文件实验室/账号登录</title> <style> body { font-family: "楷体", serif; } .container { display: flex; flex-direction: row; align-items: center; justify-content: space-between; padding: 20px; } .input-container { display: flex; flex-direction: row; align-items: center; margin-right: 20px; width: 50%; } input[type="email"], input[type="text"] { padding: 10px; font-size: 16px; border: none; border-radius: 5px; margin-right: 10px; width: 100%; } #get-verification-code-btn, #login-btn { padding: 10px; font-size: 16px; background-color: #4CAF50; color: white; border: none; border-radius: 5px; cursor: pointer; } #get-verification-code-btn.disabled { background-color: grey; cursor: not-allowed; } </style> </head> <body> <div class="container"> <h1>文件实验室/账号登录</h1> <div class="input-container"> <input type="email" placeholder="输入接收验证码的邮箱"> <button id="get-verification-code-btn">获取验证码</button> </div> <div class="input-container"> <input type="text" placeholder="输入验证码"> <button id="login-btn">登录</button> </div> </div> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script> var timer; var countdown = 60; function disableBtn() { $('#get-verification-code-btn').addClass('disabled'); $('#get-verification-code-btn').prop('disabled', true); timer = setInterval(function() { countdown--; $('#get-verification-code-btn').text(countdown + '秒后再试'); if (countdown == 0) { clearInterval(timer); enableBtn(); } }, 1000); } function enableBtn() { countdown = 60; $('#get-verification-code-btn').removeClass('disabled'); $('#get-verification-code-btn').prop('disabled', false); $('#get-verification-code-btn').text('获取验证码'); } $(document).ready(function() { $('#get-verification-code-btn').click(function() { disableBtn(); var email = $('input[type="email"]').val(); $.ajax({ type: "POST", url: "/admin/", data: {email: email}, success: function(response) { console.log(response); // handle response }, error: function(error) { console.log(error); } }); }); $('#login-btn').click(function() { var verificationCode = $('input[type="text"]').val(); $.ajax({ type: "POST", url: "/response/", data: {verificationCode: verificationCode}, success: function(response) { console.log(response); if (response == 'success') { window.location.href = 'https://www.spacexs.cn'; } else { alert('验证码错误,请重新输入'); } }, error: function(error) { console.log(error); } }); }); }); </script> </body> </html>
时间: 2023-12-06 09:39:55 浏览: 33
这是一个简单的HTML页面,用于实现一个文件实验室的账号登录功能。页面包括一个标题和两个输入框,分别用于输入邮箱和验证码,并且有一个获取验证码的按钮和一个登录按钮。当用户点击获取验证码按钮时,通过jQuery发送一个POST请求到服务器,然后按钮被禁用并且倒计时开始。当倒计时结束后,按钮会重新变为可用状态。当用户点击登录按钮时,又会发送一个POST请求到服务器,然后根据返回结果决定是否跳转到另一个页面。这个页面使用了jQuery来实现按钮的禁用和倒计时功能,同时使用了Ajax来进行异步数据交互。
相关问题
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> 绿叶学习网; </body> </html>哪里错了
根据你提供的代码,我发现以下几个问题:
1. 缺少`<!DOCTYPE html>`声明,这个声明告诉浏览器使用哪个HTML版本来解析页面。
2. 缺少`<title>`标签,这个标签用于定义网页的标题,显示在浏览器的标题栏或标签页上。
3. 缺少`<body>`标签内的内容,这个标签用于定义网页的主体内容,可以在其中添加文本、图片、链接等元素。
修正后的代码如下所示:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>绿叶学习网</title>
</head>
<body>
绿叶学习网
</body>
</html>
```
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Not found</title> </head> <body> <h1>Not found</h1> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Not found</title> </head> <body> <h1>Not found</h1> </body> </html>是一个HTML页面模板,它是一个简单的404页面,用于显示“Not found”错误信息。在这个模板中,<!DOCTYPE html>定义了文档类型,<html>标签定义了HTML文档的根元素,<head>标签定义了文档的头部部分,<meta charset="UTF-8">指定了文档的字符编码为UTF-8,<title>标签定义了文档的标题,<body>标签定义了文档的主体部分,<h1>标签定义了一个一级标题。