summaryrefslogtreecommitdiff
path: root/Base
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-18 21:42:40 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-18 21:42:40 +0200
commit1ec4db04cd4a04263c7081d95fbc804b2e610b42 (patch)
treeb1c70aff42dd6ab66300875b562db2420f40f794 /Base
parenta1e7aa330cf50326b99a398293e582a551cbd8fb (diff)
downloadserenity-1ec4db04cd4a04263c7081d95fbc804b2e610b42.zip
LibWeb: Add a simple window.location object with some getters :^)
Diffstat (limited to 'Base')
-rw-r--r--Base/home/anon/www/location.html17
-rw-r--r--Base/home/anon/www/welcome.html1
2 files changed, 18 insertions, 0 deletions
diff --git a/Base/home/anon/www/location.html b/Base/home/anon/www/location.html
new file mode 100644
index 0000000000..61a42351c6
--- /dev/null
+++ b/Base/home/anon/www/location.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>window.location test</title>
+ </head>
+ <body>
+ <pre></pre>
+ <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';
+ </script>
+ </body>
+</html>
diff --git a/Base/home/anon/www/welcome.html b/Base/home/anon/www/welcome.html
index 48f42c30df..3ac63a9022 100644
--- a/Base/home/anon/www/welcome.html
+++ b/Base/home/anon/www/welcome.html
@@ -28,6 +28,7 @@ span#ua {
<p>Your user agent is: <b><span id="ua"></span></b></p>
<p>Some small test pages:</p>
<ul>
+ <li><a href="location.html">window.location property</a></li>
<li><a href="percent-css.html">CSS percentage values</a></li>
<li><a href="inline-block.html">display: inline-block; test</a></li>
<li><a href="canvas-path-quadratic-curve.html">canvas path quadratic curve test</a></li>