blob: 6ba0a664a0e3799f1f0d09bec4470d162528c533 (
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
26
27
28
29
30
|
<html>
<head>
<title>Prerender fragment testing under location.hash change</title>
<script>
if (window.location.hash === "") {
window.location.hash = "fragment";
}
var pageWasPrerendered = false;
function DidPrerenderPass() {
pageWasPrerendered = true;
return window.location.hash === "#fragment";
}
// Make sure DidPrerenderPass() was called first. Otherwise, the page was
// most likely reloaded instead of using the prerendered page.
function DidDisplayPass() {
return pageWasPrerendered && window.location.hash === "#fragment";
}
</script>
</head>
<body>
<a name="fragment">Fragment</a>
</body>
</html>
|