]> source.dussan.org Git - nextcloud-server.git/commitdiff
Updated docs.
authorThomas Tanghus <thomas@tanghus.net>
Mon, 15 Apr 2013 20:10:29 +0000 (22:10 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Mon, 15 Apr 2013 20:10:29 +0000 (22:10 +0200)
core/js/octemplate.js

index f25f70eb375c54d1d8a1c83fe9eb1ca9b308007c..a5d56852a5754c6e40fb4e483ba8914c599f9092 100644 (file)
@@ -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:
  *