标签:文件 tps 资讯 浏览器 params input 路径 cat fun
window.location对象可用于获取当前页面地址(url)并把浏览器重定向到新页面。
window.location 对象可不带 window 前缀书写。
一些例子:
window.location.assign() 方法加载新文档。
加载新文档:
<!DOCTYPE html>
<html>
<body>
<h1>window.location 对象</h1>
<input type="button" value="加载新的文档" onclick="newDoc()">
<script>
function newDoc() {
window.location.assign("http://www.w3school.com.cn")
}
</script>
</body>
</html>
来源:站长资讯平台
标签:文件 tps 资讯 浏览器 params input 路径 cat fun
原文地址:https://www.cnblogs.com/1994jinnan/p/12178056.html