1.1. Insert single element:
Presss the update button.

Control multiple ajax calls and style changes via html attributes in a cli like manner.
hudx is heavily inspired by htmx and relies on the power of hypermedia. Htmx is awesome!!!
This small (200loc) package was created to add complex behaviour to a small widget for an existing website, which I was not able to achive easily with htmx.
Be warned: this is a toy project, not optimized for heavy interactions.
hudx
hdx: 'event' 'method' 'url' 'target' 'position'
'event': click, load, focus, input,... full list
'method': GET
'url': any url responding with html
'target': this, css ID selector
'position': outerHTML, innerHTML, beforebegin, beforeend, afterbegin, afterend
Presss the update button.
Hover and presss the update button.
Note that this action will only remove elements from the page wihtout posting anything to the server. If you want send data please read: Send. Required that the server responds with an empty body.
hudx
hdx: 'event' 'method' 'url' 'target' 'position'
'event': click, load, focus, input,... full list
'method': GET
'url': any url responding with empty body
'target': this, css ID selector
'position': outerHTML, innerHTML
Presss the update button.
Data contains the name and value attributes of input tags within the form elements.
hudx
hdx: 'event' 'method' 'url' 'target' 'position' 'form element 1' 'form element 2' ...
'event': click, load, focus, input,... full list
'method': POST, PUT, DELETE,... full list
'url': any url responding with html or empty body
'target': this, css ID selector
'position': outerHTML, innerHTML, beforebegin, beforeend, afterbegin, afterend
'form element': css ID selector of a form element
Fill the form and presss the send button.
Fill the forms and presss the send button.
request initiated: hds-r
success received: hds-s
error received: hds-er
error on connection: hds-ec
hudx
hdx: 'event' 'method' 'url' 'target' 'position' 'form element 1' 'form element 2' ...
'event': click, load, focus, input,... full list
'method': GET, POST, PUT, DELETE,... full list
'url': any url responding with html or empty body
'target': this, css ID selector
'position': outerHTML, innerHTML, beforebegin, beforeend, afterbegin, afterend
'form element': css ID selector of a form element
hds-r: 'targets' 'action' 'classname 1' 'classname 2' ...
hds-s: 'targets' 'action' 'classname 1' 'classname 2' ...
hds-er: 'targets' 'action' 'classname 1' 'classname 2' ...
hds-ec: 'targets' 'action' 'classname 1' 'classname 2' ...
'targets': css selector
'action': add, remove, toggle
'classname': name of a class
Presss the update button.
Presss the update button and wait for the slow response.
Presss the update button and wait for the slow response.
Presss the update button.
Please note, the error here is simulated/faked, real connection error is not immediate.
hudx
hdsx: 'event' 'target' 'action' 'classname 1' 'classname 2' ...
'event': click, load, focus, input,... full list
'target': this, css selector
'action': add, remove, toggle
'classname': name of a class
Presss the toggle button.
Disable cache and refresh the page.
Image loading takes 2 seconds.
Press the edit button.
Press the open button.