Trongate MX Attribute Reference
The table below offers a quick reference for all Trongate MX attributes.
Attribute | Description |
---|---|
mx-animate-error
|
Triggers an error animation when an HTTP request returns a response code less than 200 or greater than or equal to 300 (failed request) |
mx-animate-success
|
Triggers a success animation when an HTTP request returns a response code between 200 and 299 (successful request) |
mx-after-swap
|
Executes a specified JavaScript function immediately after a successful content swap operation, allowing for further DOM manipulation or initialization. |
mx-build-modal
|
Dynamically creates and populates modal dialogs with content fetched via HTTP request |
mx-close-on-error
|
Automatically closes an opened and visible modal when an HTTP request returns a response code less than 200 or greater than or equal to 300 (failed request) |
mx-close-on-success
|
Automatically closes an opened and visible modal when an HTTP request returns a response code between 200 and 299 (successful request) |
mx-delete
|
Issues a DELETE request to the specified URL |
mx-during-request
|
Controls the appearance or behavior of the target element while an AJAX request is in progress, such as cloaking or replacing content. |
mx-get
|
Issues a GET request to the specified URL |
mx-headers
|
Specifies custom headers for the HTTP request |
mx-indicator
|
Specifies an element to show as a loading indicator during the HTTP request |
mx-on-error
|
Specifies an element to be initialized or updated after a failed HTTP request (response code less than 200 or 300 and above) |
mx-on-success
|
Specifies an element to be initialized or updated after a successful HTTP request (response code 200-299) |
mx-patch
|
Issues a PATCH request to the specified URL |
mx-post
|
Issues a POST request to the specified URL |
mx-put
|
Issues a PUT request to the specified URL |
mx-remove
|
Removes the closest ancestor element from the DOM when an interactive element with the <code>mx-remove</code> attribute is triggered by a user action, such as a button click. |
mx-select
|
Selects content to swap in from a response |
mx-select-oob
|
Selects content to swap in from a response, outside the target (out of band) |
mx-swap
|
Controls how content will be swapped in (innerHTML, outerHTML, beforebegin, etc.) |
mx-target
|
Specifies the target element to be swapped |
mx-token
|
Attaches a Trongate Token to the HTTP request for authentication |
mx-trigger
|
Specifies the event that triggers the HTTP request |
mx-vals
|
Attach additional values to your HTTP requests as if they were submitted as part of an ordinary HTML form |
For detailed information on each attribute, please refer to the individual documentation pages.