diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2013-04-15 22:10:29 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2013-04-15 22:10:29 +0200 |
commit | 155582ab70b0a469f1d0a7159a16334283f91bbc (patch) | |
tree | 76b02677acca0f8491a701ba9cfbcf5e99849a9f /core/js/octemplate.js | |
parent | 870b73ce5a3140da651033696b47eccf676869b1 (diff) | |
download | nextcloud-server-155582ab70b0a469f1d0a7159a16334283f91bbc.tar.gz nextcloud-server-155582ab70b0a469f1d0a7159a16334283f91bbc.zip |
Updated docs.
Diffstat (limited to 'core/js/octemplate.js')
-rw-r--r-- | core/js/octemplate.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/js/octemplate.js b/core/js/octemplate.js index f25f70eb375..a5d56852a57 100644 --- a/core/js/octemplate.js +++ b/core/js/octemplate.js @@ -5,12 +5,17 @@ * * Usage examples: * - * var str = 'Bake, uncovered, until the {greasystuff} is melted and the {pasta} is heated through, about {min} minutes.' - * $(str).octemplate({greasystuff: 'cheese', pasta: 'macaroni', min: 10}); + * var htmlStr = '<p>Bake, uncovered, until the {greasystuff} is melted and the {pasta} is heated through, about {min} minutes.</p>' + * $(htmlStr).octemplate({greasystuff: 'cheese', pasta: 'macaroni', min: 10}); * * var htmlStr = '<p>Welcome back {user}</p>'; * $(htmlStr).octemplate({user: 'John Q. Public'}, {escapeFunction: null}); * + * Be aware that the target string must be wrapped in an HTML element for the plugin to work. The following won't work: + * + * var textStr = 'Welcome back {user}'; + * $(textStr).octemplate({user: 'John Q. Public'}); + * * For anything larger than one-liners, you can use a simple $.get() ajax request to get the template, * or you can embed them it the page using the text/template type: * |