blob: 9405fd93fcc6936b4b6cc1069ea81b2b351d399b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
<!DOCTYPE html>
<html>
<head>
<title>window.location test</title>
<style>
#clickme { background-color: red; color: yellow; }
</style>
</head>
<body>
<pre></pre>
<div id="clickme">Click me to navigate away!</div>
<script>
var pre = document.querySelectorAll("pre")[0];
pre.innerHTML += "href: " + location.href + '\n';
pre.innerHTML += "hostname: " + location.hostname + '\n';
pre.innerHTML += "pathname: " + location.pathname+ '\n';
pre.innerHTML += "hash: " + location.hash + '\n';
pre.innerHTML += "search: " + location.search + '\n';
document.getElementById("clickme").addEventListener("mousedown", function() {
window.location.href = 'http://serenityos.org/';
});
</script>
</body>
</html>
|