<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<title>URL跳转</title>
</head>
<body>
<script type="text/javascript" src="jquery-1.10.1.min.js" ></script>
<script>
//隐藏转跳,浏览器不产生历史记录(replace)
//window.location.replace("http://onestopweb.iteye.com/");
//当然我们还不能忘记常用的a标签(href)
//window.location.href = "http://onestopweb.iteye.com/";
//JQ跳转
$(location).attr('href','http://onestopweb.iteye.com/');
</script>
</body>
</html>
效果图:
本文介绍了一种使用JavaScript和jQuery实现网页URL跳转的方法。通过修改`window.location`属性或利用jQuery来改变页面地址,可以实现平滑且不留下浏览器历史记录的跳转效果。
1553

被折叠的 条评论
为什么被折叠?



