htmx icon indicating copy to clipboard operation
htmx copied to clipboard

Head Tag support not working on Version 2.0-alpha1

Open stedekay opened this issue 1 year ago • 0 comments

I am testing the 2.0-alpha1 version and tried to merge the head section. According to the documentation I don't need the head-support extension anymore. So I built a minimal HTML test page. When I use 1.9.10 with the extension everything is working fine, but not on 2.0-alpha1.

This is my HTML:

index.html:

<!doctype html>
<html>

<head>
    <meta charset="UTF-8"/>
    <title>Index</title>
    <script src="https://unpkg.com/[email protected]/dist/htmx.min.js"></script>
    <script>
        alert('index');
    </script>
</head>

<body hx-boost="true">
<a href="about.html">About</a>
</body>
</html>

about.html:

<!doctype html>
<html>

<head>
	<meta charset="UTF-8" />
	<title>About</title>
	<script src="https://unpkg.com/[email protected]/dist/htmx.min.js"></script>
	<script>
		alert('about');
	</script>
</head>

<body hx-boost="true">
  <a href="index.html">Index</a>
</body>
</html>

I should see the alert when clicking any anchor link, but I can see it only when refreshing the full page. In fact only the title gets updated in the head. Did I misunderstand the docs or is this a bug in the alpha release?

stedekay avatar Feb 07 '24 08:02 stedekay