Created
December 29, 2023 03:50
-
-
Save cgsdev0/bd79832a14b2420bc9e6dcabbb6f27dd to your computer and use it in GitHub Desktop.
htmx.trigger test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
htmx_page <<-EOF | |
<script> | |
window.addEventListener("DOMContentLoaded", () => { | |
htmx.trigger("#thing", "myEvent", {answer : 42}); | |
}); | |
</script> | |
<div id="thing" hx-trigger="myEvent" hx-post="/test"></div> | |
EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
htmx_page <<-EOF | |
<h2>Headers</h2> | |
<pre> | |
$(for i in "${!HTTP_HEADERS[@]}"; do | |
printf "%s=%s\n" "$i" "${HTTP_HEADERS[$i]}" | |
done) | |
</pre> | |
<h2>Body</h2> | |
<pre> | |
${REQUEST_BODY} | |
</pre> | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment