我用JS事件触发表单提交,没有反应,然而js的警告窗口可以弹出,是表单提交代码错误,还是jquery包没导入成功,求路过的好心人帮助查找;<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<%=basePath%>resources/css/Teacher/subjectU.css" type="text/css" rel="stylesheet"/>
<script src="<%=basePath%>resources/js/commons/jquery-1.8.0.min.js"></script>
<script src="<%=basePath%>resources/js/teacher/subjectU.js"></script>
<title>Content</title>
</head>
<body>
<div id="wrap">
<div id="capwrap">
<div id="cap">试题编辑</div>
</div>
<div id="content">
<form id="mainForm" action="<%=basePath%>querySubjectAction" method="get">
<input id="currentPage" type="hidden" name="currentPage" />
<div id="top">
<label for="subjectType">类型:</label>
<input id="subjectType" type="text" name="subjectType" />
<label for="subjectTitle">描述:</label>
<input id="subjectTitle" type="text" name="subjectTitle" />
<input type="submit" value="查询"/>
<div class="right">
<button id="delBatch">删除</button>
</div>
</div>
<table cellpadding="0" cellspacing="0">
<tr class="head">
<td class="firTD"><input type="checkbox" name="id" /></td>
<td class="order">序号</td>
<td class="subType">类型</td>
<td class="subDisc">描述</td>
<td colspan="2">操作</td>
</tr>
<c:forEach items="${subjects}" var="subject" varStatus="status">
<tr <c:if test="${status.index%2!=0}">style='color:white;background-color:#069;'</c:if>>
<td class="firTD"><input type="checkbox" name="subjectID" value="${subject.subjectId}"/></td>
<td class="order">${status.index+1}</td>
<td class="subType">${subject.subjectType}</td>
<td class="subDisc">${subject.subjectTitle}</td>
<td class="subUp"><a href="#">修改</a></td>
<td class="subDel"><a href="#">删除</a></td>
</tr>
</c:forEach>
</table>
<div class="abs">
共<b>${page.totalNumber}</b>条
<button onclick="pageClick(1);">首页</button>
<button onclick="pageClick(${page.currentPage-1});">上一页</button>
当前第<span>${page.currentPage}/${page.totalPage}</span>页
<button onclick="pageClick(${page.currentPage+1});">下一页</button>
<button onclick="pageClick(${page.totalPage});">尾页</button>
跳至<input name="pageNumber" type="text" id="pageNumber" />页 <span onclick="goClick();" id="go">GO</span>
</div>
</form>
</div>
</div>
</body>
</html>/**
* 点击换页
* */
function pageClick(currentPage){
alert("!!!");
$("#currentPage").attr("value",curentPage);
$("#mainForm").submit();
}
/**
* GO点击事件
* */
function goClick(){
var goPage = $("#pageNumber").val();
$("#currentPage").val(goPage);
$("#mainForm").submit();
}js文件路径如下:
添加回答
举报
0/150
提交
取消