-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support hx-target-XXX ? #58
Comments
Hey @StefH, Natively Htmxor will support what Htmx comes with out of the box. To support any extensions, Htmxor will probably need to be expanded with a generic In this particular case, I am not sure Htmxor needs anything besides what it already has for the response-targets extension to work. You can set the status code through |
Hi @egil, I got this working in the demo app with: 1️⃣Adding builder.AddMarkupContent(2, @"<script defer src=""_content/Htmxor/htmx/response-targets.js""></script>"); to HtmxHeadOutlet. Note that just adding the script in my main app: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="/" />
<link rel="stylesheet" href="bootstrap/bootstrap.min.css" />
<link rel="stylesheet" href="app.css" />
<link rel="stylesheet" href="MinimalHtmxorApp.styles.css" />
<link rel="icon" type="image/png" href="favicon.png" />
<HtmxHeadOutlet UseEmbeddedHtmx="false" />
<script src="https://unpkg.com/[email protected]/dist/ext/response-targets.js"></script>
<HeadOutlet />
</head>
<body hx-boost="true">
<Routes />
</body>
</html> Did not work?
2️⃣ Update html + blazor code:
However, I actually want to return the exception message back. Instead of the normal body: <p role="status">
Current count: 5</p>
<button class="btn btn-primary" hx-put="/counter" hx-vals="{ "CurrentCount": 5 }" hx-target="#counter" hx-target-5*="#serious-errors" hxor-eventid="0567AF4F">
Click me
</button>
<div id="serious-errors"></div> Is this scenario supported in Htmx? |
In this case you should not set If you just want to use an additional htmx extensions, just include it after the |
Some statuscodes result in no content being sent, i.e. I am still learning htmx though, so I am not entirely sure how it behaves by default with 500 status codes. It does have some default behaviors with 404 status code and others but your extension may override that. |
Hello Egil, do you have any plans to support this https://htmx.org/extensions/response-targets/ ?
The text was updated successfully, but these errors were encountered: