Main Menu

hx-get attribute

Started by rooot, February 02, 2024, 12:40:00 PM

Previous topic - Next topic


Do you plan to support the hx-get attribute? It makes the browser issue a GET request to another URL and inserts the contents into the current page. This can also happen recursively, with those loaded contents in turn containing hx-get attributes that load contents from more URLs.

Explanation from here:

QuoteThe hx-get attribute will cause an element to issue a GET to the specified URL and swap the HTML into the DOM using a swap strategy:
  <div hx-get="/example">Get Some HTML</div>This example will cause the div to issue a GET to /example and swap the returned HTML into the innerHTML of the div.