page1.html 742 B

1234567891011121314151617181920
  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 1</title>
  5. <p>The <code>next</code> query param must be the URL for the next page to
  6. link to.
  7. <script>
  8. var match = document.location.search.match(/next=(.*)/);
  9. if (match && match.length == 2) {
  10. var next = decodeURIComponent(match[1]);
  11. var link = document.createElement('a');
  12. link.innerText = 'Next!';
  13. link.textContent = 'Next!';
  14. link.id = 'next';
  15. link.href = next + '?next=' + encodeURIComponent(
  16. 'http://' + document.location.host +
  17. document.location.pathname.replace('page1.html', 'page3.html'));
  18. document.body.appendChild(link);
  19. }
  20. </script>