Skip to content
Snippets Groups Projects
Commit 155582ab authored by Thomas Tanghus's avatar Thomas Tanghus
Browse files

Updated docs.

parent 870b73ce
No related branches found
No related tags found
No related merge requests found
...@@ -5,12 +5,17 @@ ...@@ -5,12 +5,17 @@
* *
* Usage examples: * Usage examples:
* *
* var str = 'Bake, uncovered, until the {greasystuff} is melted and the {pasta} is heated through, about {min} minutes.' * var htmlStr = '<p>Bake, uncovered, until the {greasystuff} is melted and the {pasta} is heated through, about {min} minutes.</p>'
* $(str).octemplate({greasystuff: 'cheese', pasta: 'macaroni', min: 10}); * $(htmlStr).octemplate({greasystuff: 'cheese', pasta: 'macaroni', min: 10});
* *
* var htmlStr = '<p>Welcome back {user}</p>'; * var htmlStr = '<p>Welcome back {user}</p>';
* $(htmlStr).octemplate({user: 'John Q. Public'}, {escapeFunction: null}); * $(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, * 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: * or you can embed them it the page using the text/template type:
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment