hashchange.html 307 B

12345678910111213141516
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>hashchange test</title>
  6. </head>
  7. <body style="background:red;overflow:hidden;">
  8. <script>
  9. addEventListener('hashchange', function() {
  10. document.body.style.background = 'lime';
  11. }, false);
  12. location.hash = Math.random();
  13. </script>
  14. </body>
  15. </html>