我总结了这五种方法:
第一种:使用JS跳转页面
(1)跳转带参
<script language="javascript" type="text/javascript">
window.location.href="jingxuan.do?backurl=" + window.location.href;
</script>
(2)跳转无参
<script>window.location.href='http://blog.yoodb.com';</script>
第二种:返回上一次预览界面
<script language="javascript">
alert("返回");
window.history.back(-1);
</script>
HTML页面嵌套
<a href="javascript:history.go(-1)">返回上一步</a>
<a href="<%=Request.ServerVariables("HTTP_REFERER")%>">返回上一步</a>
第三种:button按钮添加事件跳转
<input name="前端知音" type="button" value="前端知音" onClick="location.href='login.do'">
第四种:在新窗口打开
<a href="javascript:" onClick="window.open('login.do','','height=500,width=611,scrollbars=yes,status=yes')">新窗口</a>
第五种:通过meta设置跳转页面
<head>
<!--只刷新不跳转 -->
<meta http-equiv="refresh" content="5">
<!--定时跳转 -->
<meta http-equiv="refresh" content="5;url=index.html">
</head>
这里还有一个页面传值
第一个页面
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<SCRIPT LANGUAGE="JavaScript">
function test(){
var s = document.getElementById("txt");
location.href="test2.html?"+"txt="+encodeURI(s.value);
}
</SCRIPT>
<body>
<input type="text" id="txt">
</br>
<input type="button" value="TEST" onclick="test()"/>
</body>
</html>
第二个页面
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<script language="javascript" type="text/javascript">
var loc = location.href;
var n1 = loc.length;//地址的总长度
var n2 = loc.indexOf("=");//取得=号的位置
var id = decodeURI(loc.substr(n2+1, n1-n2));//从=号后面的内容
alert(id);
//document.write(id)
</script>
</body>
</html>