Skip to content

Commit

Permalink
Document support opening links in a new tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalabasa committed Feb 24, 2024
1 parent 6ad3a76 commit f9b1235
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,33 @@ <h3>Clean target values</h3>
</p>
</section>

<section>
<h3>Support opening links in a new tab</h3>
<p>
In the htmz model, you link to HTML <em>fragments</em> that are
designed to be inserted into an existing page. But what if the user
opens these links in a new tab? They would see these partial UIs on
their own &mdash; a pretty bad user experience!
</p>
<p>
Using the
<a
href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-Dest"
target="_blank"
>Sec-Fetch-Dest</a
>
header, you can
<a
href="https://github.com/Kalabasa/htmz/blob/master/examples/php_new_tab_detection/content.php"
target="_blank"
>fall back to a full page</a
>
in these cases. This header lets the server know the request’s
destination and render either a framgment or a full page
appropriately.
</p>
</section>

<section>
<h3>Scripting / interactivity</h3>
<p>
Expand Down

0 comments on commit f9b1235

Please sign in to comment.