mixhtml

Request

A request needs to be started or triggered. The request, as for this version of mixhtml, can be started on click, submit, onfocus, onblur, onchange, and oninput. All other events,for example: hover, key press, key up, and so on, are most likely unecessary and rarely used and therefore are not part of mixhtml.

mix-get

mix-get In a hyperlink, the url in the href attribute is used

<a href="item" mix-get>Get item</a>

mix-get In a form, the url in the action attribute is used

<form action="items" mix-get>Get item</form>

mix-get In a button, the url in the mix-get attribute is used

<button mix-get="item">Get item</button>

mix-post

mix-post

In a form, the url in the action attribute is used

<form action="items" mix-post><button>Submit</button></form>

mix-post

In a form, the value in the mix-post attribute is used. For SEO reasons, this is not the recommended approach, yet it works.

<form mix-post="items"><button>Submit</button></form>

mix-post

In a button, the url in the mix-post attribute is used

<button mix-post="items">Submit</button>

mix-put

mix-put

In a form, the url in the action attribute is used

<form action="items" mix-put><button>Submit</button></form>

mix-put

In a form, the value in the mix-put attribute is used. For SEO reasons, this is not the recommended approach, yet it works.

<form mix-put="items"><button>Submit</button></form>

mix-put In a button, the url in the mix-put attribute is used

<button mix-put="items">Submit</button>

mix-patch

mix-patch

In a form, the url in the action attribute is used

<form action="items" mix-patch><button>Submit</button></form>

mix-patch

In a form, the value in the mix-patch attribute is used. For SEO reasons, this is not the recommended approach, yet it works.

<form mix-patch="items"><button>Submit</button></form>

mix-patch In a button, the url in the mix-patch attribute is used

<button mix-patch="items">Submit</button>

mix-delete

mix-delete In a hyperlink, the url in the href attribute is used

<a href="items" mix-delete>Get item</a>

mix-delete In a form, the url in the action attribute is used

<form action="items" mix-delete><button>Submit</button></form>

mix-delete In a button, the url in the mix-delete attribute is used

<button mix-delete="items">Submit</button>

mix-input

mix-input Sets an "oninput" event on the element. This attribute should be used in an input or text field. When something is typed in the field, the request will be sent. Can be used in any tag together with any HTTP method

<input mix-get="/items" mix-input>

<input mix-post="/items" mix-input>

<textarea mix-get="/items" mix-input><textarea>

<textarea mix-post="/items" mix-input><textarea>

mix-delay

mix-delay Sets an "oninput" event on the element. This attribute should be used in an input or text field. When something is typed in the field, the request will delayed. The time is in milliseconds. Can be used in any tag together with any HTTP method

<input mix-get="/items" mix-delay="1000">

<input mix-post="/items" mix-delay="1000">

<textarea mix-get="/items" mix-delay="1000"><textarea>

<textarea mix-post="/items" mix-delay="1000"><textarea>

mix-focus

mix-focus Sets an "onfocus" event on the element. This tag should be used in an input or text field. When the element is "focused", the request will be sent. Can be used in any tag together with any HTTP method

<input mix-get="/items" mix-focus>

<input mix-post="/items" mix-focus>

<textarea mix-get="/items" mix-focus><textarea>

<textarea mix-post="/items" mix-focus><textarea>

mix-blur

mix-blur Sets an "onblur" event on the element. This tag should be used in an input or text field. When the element is "blured", the request will be sent. Can be used in any tag together with any HTTP method

<input mix-get="/items" mix-blur>

<input mix-post="/items" mix-blur>

<textarea mix-get="/items" mix-blur><textarea>

<textarea mix-post="/items" mix-blur><textarea>

mix-cover

mix-blur Element that is shown while the fetch request is executed. The element will be hidden once the response is received. Add the class mix-hidden to the element.

<div id="the-cover" class="mix-hidden"></div>

<a href="item" mix-cover="#the-cover" mix-get>Get item</a>

mix-await + mix-done

mix-await + mix-done Caption shown on the button or hyperlink while the ajax/fetch request is being processed. Once the ajax/fetch request has finished the value in the attribute mix-done will replace the text of the button or hyperlink.

<button mix-await="Please wait..." mix-done="Get item">Get item</button>

mix-validate

mix-validate Defines the rules that the element must past in order for the ajax/fetch request to take place. The values is a regular expression. If the element doesn't pass the validation, the background color of the field will change according to the CSS rules injected by mixhtml.

<input mix-post="items" mix-validate="^.{2,20}$">