Skip to content

Instantly share code, notes, and snippets.

@matthewp
Last active September 7, 2018 20:31
Show Gist options
  • Save matthewp/6afe8de556e7a0db0ae8ea25db2e0930 to your computer and use it in GitHub Desktop.
Save matthewp/6afe8de556e7a0db0ae8ea25db2e0930 to your computer and use it in GitHub Desktop.
Page test
<!doctype html>
<html lang="en">
<title>Page 1</title>
<main id="main"></main>
<h1>Links</h1>
<ul>
<li><a href="/about">About</a></li>
<li><a href="/page2.html">Page 2</a></li>
</ul>
<script src="//unpkg.com/page/page.js"></script>
<script>
page("/page1.html", function() {
main.textContent = "Page 1";
});
page("/about", function() {
main.textContent = "About page"
});
page();
</script>
<!doctype html>
<html lang="en">
<title>Page 2</title>
<main id="main"></main>
<h1>Links</h1>
<ul>
<li><a href="/about">About</a></li>
<li><a href="/page1.html">Page 1</a></li>
</ul>
<script src="//unpkg.com/page/page.js"></script>
<script>
page("/page2.html", function() {
main.textContent = "Page 2";
});
page("/about", function() {
main.textContent = "About page"
});
page();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment