See the web page for complete documentation and examples.
Introduction | DocumentationHTMZ is a minimalist HTML microframework for creating interactive and modular web user interfaces with the familiar simplicity of plain HTML. This is an "extension" that I have made to make it even more powerful and flexible.
Features:
- Automatic partial page updates
- Seamless form submissions
- Back end driven hypermedia requests. The back end determines how to update the front end.
- Lightweight and easy to use
This implementation of HTMZ uses four APIs to determine how the updates are applied.
idThe id attribute matches the element that will be updated. It replaces the original element with the new content. This is the simplicist and easiest way to perform updates.
hz-targetuses the query selector to determine what element to update.
hz-swapdetermines how the content is inserted. There are four different values which can be used:
replaceWith- replaces the content of the target element (default). In practice this never needs to be explicit.append- appends the content to the end of the target elementprepend- prepends the content to the beginning of the target elementbefore- inserts the content before the target elementafter- inserts the content after the target element
templateWhen you do not have a root HTML element use the
templateelement. This is useful for inserting table rows, list items, and other elements that do not have a single root element. When you return an emptytemplateit will delete the old template when you use the strategyreplaceWith(which is default, of course).