获取href连接:

 

<!DOCTYPE html>
<html>
<head>
<script src="/jquery/jquery-1.11.1.min.js"></script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    alert($("#w3s").attr("href"));
  });
});
</script>
</head>

<body>
<p><a href="http://www.w3school.com.cn" id="w3s">W3School.com.cn</a></p>
<button>显示 href 值</button>
</body>

</html>

 

试验编辑器:点击进入 跳转:

 

1.在原来的窗体中直接跳转用

window.location.href="你所要跳转的页面";

2、在新窗体中打开页面用:

window.open('你所要跳转的页面');

window.history.back(-1);返回上一页