mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 11:05:03 +01:00
prototype for hash changes in IE11
This commit is contained in:
parent
2333a959a2
commit
2b2392f375
24
prototypes/ie11-hashchange.html
Normal file
24
prototypes/ie11-hashchange.html
Normal file
@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<ul id="changes"></ul>
|
||||
<script type="text/javascript">
|
||||
const ul = document.getElementById("changes");
|
||||
window.onhashchange = function() {
|
||||
const hash = document.location.hash.substr(1);
|
||||
const li = document.createElement("li");
|
||||
li.appendChild(document.createTextNode(hash));
|
||||
ul.appendChild(li);
|
||||
window.history.replaceState(null, null, "#" + hash + hash);
|
||||
}
|
||||
</script>
|
||||
<p>
|
||||
<a href="#foo">foo</a>
|
||||
<a href="#bar">bar</a>
|
||||
<a href="#baz">baz</a>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user