summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorcarson <carson@leaddyno.com>2022-02-19 12:23:11 -0700
committercarson <carson@leaddyno.com>2022-02-19 12:23:11 -0700
commitc55b8c052df97074ee5619b23a332ee3d7e63590 (patch)
tree18e8bb2f3a7ae8d5b1523e5880fdb6ed8063347c
parent3d93251acdbe6825fb7889d0718758f989aad15b (diff)
downloadhtmx-demo.tar.gz
htmx-demo.zip
update docsdemo
-rw-r--r--www/docs.md6
-rw-r--r--www/js/demo/scratch.html2
2 files changed, 5 insertions, 3 deletions
diff --git a/www/docs.md b/www/docs.md
index c1f717f6..68e0323d 100644
--- a/www/docs.md
+++ b/www/docs.md
@@ -935,7 +935,9 @@ Simply add the following script tag to your demo/fiddle/whatever:
```
This helper allows you to add mock responses by adding `template` tags with a `url` attribute to indicate which URL.
-The response for that url will be the innerHTML of the template, making it easy to construct mock responses.
+The response for that url will be the innerHTML of the template, making it easy to construct mock responses. You can
+add a delay to the response with a `delay` attribute, which should be an integer indicating the number of milliseconds
+to delay
You may embed simple expressions in the template with the `${}` syntax.
@@ -960,7 +962,7 @@ Here is an example of the code in action:
<script>
globalInt = 0;
</script>
-<template url="/foo"> <!-- note the url attribute -->
+<template url="/foo" delay="500"> <!-- note the url and delay attributes -->
${globalInt++}
</template>
diff --git a/www/js/demo/scratch.html b/www/js/demo/scratch.html
index 1a5647c0..f2174dc1 100644
--- a/www/js/demo/scratch.html
+++ b/www/js/demo/scratch.html
@@ -20,7 +20,7 @@
<template url="/foo">
- ${hurr++}
+ ${window.globalInt++}
</template>
<template url="/bar" delay="3000">