<button>Load user info</button>
<on click>
<request-new url="/demo/user-info" method="get">
<!-- Async network call -->
<request-send>
<response-is-error>
<if-true>
<!-- Error handling -->
<selection-set-text text="Try again">
<function-return>
</if-true>
<selection-scope next-sibling=".result">
<!-- Insert response content -->
<response-get-fragment>
<selection-replace-children>
</selection-scope>
</on>
<div class="result"></div>
request onto the stack.request from the stack and sends it asynchronously. Code after this line waits for the response. Pushes the
response onto the stack.response from the stack and checks if the request failed, pushing a
bool onto the stack.bool from the stack and executes its body if true.response from the stack (still available) and extracts the HTML fragment, pushing it onto the stack.fragment from the stack and inserts it into the current selection.