<script></script>和<script language=javascript></script>的区别

当你只使用一种语言时可以不标注language,浏览器会自动解释到

如果有多种语言就必须标注language

这段代码有几个问题需要修正: 1. 在 `<script>` 标签中,`windows.location` 应该是 `window.location`,即将 `windows` 改为 `window`。 2. 在 `<c:forEach>` 标签中,`${stuList}` 后面有一个多余的空格,需要删除。 3. 在 `<button>` 标签中,`onclick` 属性中的 `Location` 应该是小写的 `location`,即将 `Location` 改为 `location`。 4. 在第二个 `<button>` 标签中,`onclick` 属性中的 `studentDeLete` 应该是 `studentDelete`,即将 `studentDeLete` 改为 `studentDelete`。 修正后的代码如下所示: ```jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>学生信息</title> <script type="text/javascript"> function studentDelete(studentId) { if(confirm("你确定要删除这个学生信息吗?")){ window.location="deletestudent?userId="+studentId; } } </script> </head> <body> <table border=1> <tr> <th>学号</th> <th>姓名</th> <th>性别</th> <th>出生年龄</th> <th>入学时间</th> <th>学院</th> <th>操作</th> </tr> <c:forEach items="${stuList}" var="stu"> <tr> <td>${stu.userId}</td> <td>${stu.userName}</td> <td>${stu.sex}</td> <td>${stu.birthYear}</td> <td>${stu.grad}</td> <td>${stu.collegeName}</td> <td> <button type="button" onclick="location='AdminServlet?action=edit$userId=${stu.userId}'">修改</button>  <button type="button" onclick="studentDelete(${stu.userId})">删除</button> </td> </tr> </c:forEach> </table> </body> </html> ``` 请注意检查其他部分的代码,以确保没有其他错误。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值