Skip to content

Instantly share code, notes, and snippets.

@afcapel
Created February 5, 2024 10:09
Show Gist options
  • Save afcapel/be046236d1b824e5510634431a92cc89 to your computer and use it in GitHub Desktop.
Save afcapel/be046236d1b824e5510634431a92cc89 to your computer and use it in GitHub Desktop.
Frame navigation
<!doctype html>
<html lang=en>
<head>
<title>Throughput</title>
<meta name=viewport content='width=device-width,initial-scale=1.0'>
<meta charset=utf-8>
<link rel=stylesheet href=styles.css>
<head>
<script type="module" src="https://cdn.jsdelivr.net/npm/@hotwired/turbo@latest/dist/turbo.es2017-esm.min.js"></script>
</head>
<script>
document.addEventListener("turbo:load", function() {
// It works!
Turbo.visit("/frame.html", { frame: "frame" });
})
</script>
</head>
<body>
<turbo-frame id="frame">
<a href="/">Root</a>
<a href="/example-content">Example Content</a>
</turbo-frame>
</body>
</html>
<turbo-frame id="frame">
<h1>Loaded!</h1>
</turbo-frame>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment