diff options
-rw-r--r-- | www/docs.md | 6 | ||||
-rw-r--r-- | www/js/demo/scratch.html | 2 |
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"> |