案例:把用户带到一个新的地址     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript">
4
function currLocation()
5
{
6
alert(window.location)
7
}
8
function newLocation()
9
{
10
window.location="/"
11
}
12
</script>
13
</head>
14
15
<body>
16
<input type="button" onclick="currLocation()" value="显示当前的 URL">
17
<input type="button" onclick="newLocation()" value="改变 URL">
18
</body>
19
20
</html>