location.html

来自「js的源码 初学js的一些小例子」· HTML 代码 · 共 29 行

HTML
29
字号
<html>
<head>
<title>HELLO</title>
</head>

<a href="#" onclick="window.location='history.html'">改变Location</a>
<p>
<a href="#" onclick="alert(window.name)">window.name</a>
<p>
<a href="#" onclick="alert('width:'+window.screen.width+'height:'+window.screen.height)">window.screen</a>
<p>
<a href="#" onclick="window.close()">window.close</a>
<p>
<a href="#" onclick="window.open('http://www.163.com')">window.open</a>

<p>
<a href="#" onclick="alert(document.title)">document.name</a>
<p>
<a href="#" onclick="alert(document.location)">document.location</a>
<p>
<a href="#" onclick="alert(document.location.href)">document.location.href</a>
<p>
<a href="#" onclick="alert(document.location.host)">document.location.host</a>
<p>
<a href="#" onclick="alert(document.location.hostname)">document.location.hostname</a>
<p>
<a href="#" onclick="document.location.reload()">document.location.reload</a>

</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?