page2.html 822 B

123456789101112131415161718192021222324
  1. <!DOCTYPE html>
  2. <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  3. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  4. <title>Page 2</title>
  5. This page is a middle man for referrer tests.
  6. This page will include a link to a "next" page if the <code>next</code> query
  7. parameter, or the <code>document.referrer</code> is set.
  8. <p><input type="button" id="forward" value="Forward" onclick="history.go(1)"/>
  9. <script>
  10. var match = document.location.search.match(/next=(.*)/);
  11. var next = document.referrer || '';
  12. if (match && match.length == 2) {
  13. next = decodeURIComponent(match[1]);
  14. }
  15. if (next) {
  16. var link = document.createElement('a');
  17. link.innerText = 'Next!';
  18. link.textContent = 'Next!';
  19. link.id = 'next';
  20. link.href = next;
  21. document.body.appendChild(link);
  22. }
  23. </script>