Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
| 2 <head> | |
| 3 <title>Prerender fragment testing under location.hash change</title> | |
| 4 | |
| 5 <script> | |
| 6 var pageWasPrerendered = false; | |
| 7 | |
| 8 function DidPrerenderPass() { | |
| 9 pageWasPrerendered = true; | |
| 10 return true; | |
| 11 } | |
| 12 | |
| 13 // Make sure DidPrerenderPass() was called first. Otherwise, the page was | |
| 14 // most likely reloaded instead of using the prerendered page. | |
| 15 function DidDisplayPass() { | |
| 16 return pageWasPrerendered; | |
| 17 } | |
| 18 | |
| 19 console.log("Current hash is '" + window.location.hash + "'"); | |
|
cbentzel
2011/04/25 19:49:48
Get rid of console.log
| |
| 20 if (window.location.hash === "") { | |
| 21 console.log(" setting hash to 'fragment'"); | |
| 22 window.location.hash = "fragment"; | |
| 23 } | |
| 24 </script> | |
| 25 | |
| 26 </head> | |
| 27 <body> | |
| 28 <a name="fragment">Fragment</a> | |
| 29 </body> | |
| 30 </html> | |
| 31 | |
| OLD | NEW |