一.页面跳转方式
1.1 JavaScript方式跳转
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<!--
页面跳转的方式
1.通过HTML超链接的方式进行跳转
<a href = "路径">资源地址</a>
2.通过js的location对象进行页面跳转
window.location.href = "路径";
-->
<!-- 通过超链接跳转到index.jsp页面 -->
<button onclick = "add();">跳转到index.jsp</button>
<script type="text/javascript">
function add(){
/* 通过js的location对象进行页面跳转 */
location.href = "index.jsp?result=123";
}
</script>
</body>
</html>
12-10
474