javascript-<from>表单提交之后,页面同步跳转

 

function uploadExcel(){
    $("#questionTypesManage").submit();    //表单提交, 页面同步跳转
    window.location.reload();    //不会执行
}
  • 可以使用ajax
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%--<html>--%> <%--<head>--%> <%-- <title>Title</title>--%> <%--</head>--%> <%--<body>--%> <%--<div>--%> <%-- <div style="color: #37ff00">${requestScope.msg}</div>--%> <%-- 用户名:<input type="text" name="username" > <br>--%> <%-- 密 码:<input type="password" name="password" > <br>--%> <form action="/userlogin" method="post"> <%-- <input type="submit" value="登录">--%> <%-- </form>--%> <%-- </div>--%> <%--</body>--%> <%--</html>--%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>注册</title> <style> .container { width: 300px; margin: 0 auto; padding: 20px; border: 1px solid #ccc; } .form-group { margin-bottom: 10px; } .form-group label { display: block; margin-bottom: 5px; } .form-group input { width: 100%; padding: 5px; } .form-group button { width: 100%; padding: 10px; background-color: #4CAF50; color: white; border: none; cursor: pointer; } </style> </head> <body> <div class="container"> <h2>登录</h2> <form id="login-form"> <div class="form-group"> <label for="username">用户名:</label> <input type="text" id="username" name="username" required> </div> <div class="form-group"> <label for="password">密码:</label> <input type="password" id="password" name="password" required> </div> <div class="form-group"> <button type="submit">登录</button> </div> </form> </div> <script> document.getElementById('login-form').addEventListener('submit', function(event) { event.preventDefault(); // 阻止提交的默认行为 var username = d帮我让这个代码把账号密码发给LoginServlet进行逻辑判断
07-24

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值