forked from uncloud/uncloud
32 lines
781 B
HTML
32 lines
781 B
HTML
<html>
|
|
<head>
|
|
<title>test</title>
|
|
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.10/dist/htmx.min.js"
|
|
integrity="sha384-H5SrcfygHmAuTDZphMHqBJLc3FhssKjG7w/CeCpFReSfwBWDTKpkzPP8c+cLsK+V"
|
|
crossorigin="anonymous"></script>
|
|
<!-- have a button POST a click via AJAX -->
|
|
</head>
|
|
<body>
|
|
<div id=parent-div>
|
|
original foo
|
|
</div>
|
|
<div id=post>
|
|
<button hx-post="http://localhost:8000/clicked"
|
|
hx-trigger="click"
|
|
hx-target="#parent-div"
|
|
hx-swap="outerHTML">
|
|
Click Me!
|
|
</button>
|
|
</div>
|
|
<div id=get>
|
|
<button hx-get="http://localhost:8000/"
|
|
hx-trigger="click"
|
|
hx-target="#parent-div"
|
|
hx-swap="outerHTML">
|
|
Click Me!
|
|
</button>
|
|
</div>
|
|
|
|
|
|
</body>
|
|
</html>
|