使用a标签和button标签实现页面的跳转再跳回来
2017-02-16 15:04
423 查看
主页面
<!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>页面的跳转</title><!--修改a标签的样式--><style type="text/css">
/*顺序需要注意*/#testColor{text-decoration: none;}#testColor:link{color: #000;}#testColor:visited{color: green;}#testColor:hover{color: skyblue;}#testColor:active{color: brown;}</style><script type="application/javascript">window.onload = function(){//使用button进行页面的跳转var button = document.getElementById("button");button.onclick = function(){// window.open("./跳转目的页面.html"); //target=_blank// window.location.href = "跳转目的页面.html"; //target=_self// self.location = "跳转目的页面.html";// window.navigate("跳转目的页面.html"); //只有IE支持top.location = "跳转目的页面.html";}}</script></head><body><a href="跳转目的页面.html" id="testColor">跳转到目的页面</a><button id="button">使用button跳转</button><br />图片链接:<a href="跳转目的页面.html"><img height="50" width="50" src="../images/2.jpg"alt="图片显示不出来了..."></a></body></html>
目的页面
<!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>跳转目的页面</title><script type="application/javascript">window.onload = function () {var button = document.getElementById("button");button.onclick = function(){//返回上一页window.history.back(-1);}}</script></head><body>跳转目的页面<button id="button">使用button跳转 返回上一页</button></body></html>
相关文章推荐
- 不使用a标签,实现点击跳转到其他页面的代码
- button和submit的区别及使用js实现页面跳转的方式
- Button 标签实现页面跳转的方法
- button和submit的区别及使用js实现页面跳转的方式
- button跟submit的区别及使用js实现页面跳转的方式
- button跟submit的区别及使用js实现页面跳转的方式
- button和submit的区别及使用js实现页面跳转的方式
- button跟submit的区别及使用js实现页面跳转的方式
- JSP页面如何访问标签中定义的变量-使用实现
- meta 标签实现页面跳转
- flex 使用viewstack实现页面的跳转
- flex4.5使用viewstack实现页面跳转
- 使用js实现页面自动跳转
- flex 使用viewstack实现页面的跳转(转)
- 如何在JSP页面中使用JSTL标签实现if-else判断
- jquery mobile使用a标签跳转页面时页面未执行pageinit事件的问题
- 如何在JSP页面中使用JSTL标签实现if和if-else判断
- 使用onclick跳转到其他页面。使用button跳转到指定url
- 使用js实现页面自动跳转
- ASP.Net中使用 window.location.href 实现页面跳转(转自:永恒的回忆)