Skip to content

v0.1.7

Latest
Compare
Choose a tag to compare
@ernestmarcinko ernestmarcinko released this 18 Oct 11:43

js:myFunc syntax

js:myFunc syntax can be used in the hx-get, hx-post etc.. tags to define handler functions implicitly.

HTML

<button hx-get="js:myFunc" hx-swap="outerHTML" hx-ext="serverless">
    Click to replace via myFunc!
</button>

JS

function myFunc(text, params, xhr) {
    return 'Hi!';
}