bigskysoftware / htmx

</> htmx - high power tools for HTML
https://htmx.org
Other
37.75k stars 1.28k forks source link

documentation incorrect for client-side-templates using a mustache template in a file #1778

Open oliverwi opened 1 year ago

oliverwi commented 1 year ago

I am referring to https://htmx.org/extensions/client-side-templates/

Using the recommend <script src...> does not work for including a mustache template file. Also <script hx-get...> does not work other than when the mustache template contains only mustached tags (without HTML tags).

I got it working by means of a hidden div element with hx-get attribute.

oliverwi commented 1 year ago

Working example using hidden <div> with hx-get attribute:

https://run.plnkr.co/preview/clmc26lc500082e6qq7m0lux0/index.html

dominikb1888 commented 11 months ago

@oliverwi Just facing the same issue. Unfortunately, the link you shared does not work anymore. Would you mind sharing this again?

ASoldo commented 8 months ago

I'm having the same issue and I really thought that I did a mistake. So, do we know how to load external template files or no?