late-king-98305
11/17/2021, 12:19 AMred-farmer-97020
11/17/2021, 12:25 AMred-farmer-97020
11/17/2021, 12:26 AMred-farmer-97020
11/17/2021, 12:27 AMproud-guitar-95305
11/17/2021, 1:02 AMtall-dinner-62086
11/17/2021, 9:42 AMfast-nest-2846
11/17/2021, 12:54 PMtall-dinner-62086
11/17/2021, 12:57 PMuser
11/17/2021, 1:06 PMuser
11/17/2021, 1:10 PMmysterious-toddler-20573
11/17/2021, 1:27 PMic-trigger="every <n>s"mysterious-toddler-20573
11/17/2021, 1:27 PMmysterious-toddler-20573
11/17/2021, 1:28 PMic-trigger='load delay:<n>s with a target or swap that replaces the elementmysterious-toddler-20573
11/17/2021, 1:29 PMmysterious-toddler-20573
11/17/2021, 1:29 PMmysterious-toddler-20573
11/17/2021, 1:29 PMuser
11/17/2021, 1:33 PMhx-swap or hx-target? It can only swap the innerHTML?stocky-mechanic-87541
11/17/2021, 1:35 PMhx-trigger it is mentioned that the from: modifier can be used with extended CSS selectors, such as closest. However, when we tried this (hx-trigger="some_event from:closest .some-class"), htmx keeps giving syntax errors.
When leaving out closest, it does seem to default to listening to the closest .some-class. Is there something wrong with our original hx-trigger that causes the syntax error and what is the default behaviour for from:.class? We don't want to listen to events from the non-closest classes.stocky-mechanic-87541
11/17/2021, 2:29 PMfrom:closest <css selector> seemed to be missing in the htmx source code. We have added this parsing and created a pull request: https://github.com/bigskysoftware/htmx/pull/663mysterious-toddler-20573
11/17/2021, 3:37 PMinnerHTML swap and keep the polling element in the dommysterious-toddler-20573
11/17/2021, 3:38 PMstocky-mechanic-87541
11/17/2021, 4:07 PMmysterious-toddler-20573
11/17/2021, 4:38 PMjolly-kite-167
11/17/2021, 4:39 PMmysterious-toddler-20573
11/17/2021, 4:39 PMmysterious-toddler-20573
11/17/2021, 4:40 PMjs
// GET requests to /filename would return "Hello, world!"
export const onRequestGet = () => {
return new Response("Hello, world!")
}
// POST requests to /filename with a JSON-encoded body would return "Hello, <name>!"
export const onRequestPost = async ({ request }) => {
const { name } = await request.json()
return new Response(`Hello, ${name}!`)
}
why is this not?
js
function onGet() {
return "Hello World"
}
function onPost(request) {
const name = request.get('name');
return `Hello ${name}`;
}mysterious-toddler-20573
11/17/2021, 4:41 PMgorgeous-iron-50959
11/17/2021, 9:41 PMon mouseover fetch /view/75 put into #oc-body then call oc.show()mysterious-toddler-20573
11/17/2021, 9:42 PMapplescript
on mouseover
fetch /view/75 then
put it into #oc-body then
call oc.show()gorgeous-ghost-95789
11/18/2021, 12:44 AMit as a crucial part of the hyperscript grammar was the thing that blew my mind / sold me on the whole project