Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script id="parent-tmpl" type="text/x-jquery-tmpl">
- <div id="parent">
- <p>{{= value}}</p>
- {{tmpl "#child"}}
- </div>
- </script>
- <script id="child" type="text/x-jquery-tmpl">
- <div class="stuff">
- </div>
- </script>
- <script id="item" type="text/x-jquery-tmpl">
- <p>{{= another_value}}</p>
- </script>
- <script type="text/javascript">
- // Change the value
- var tmpl_item = jQuery("#parent").tmplItem();
- tmpl_item.data.value = "new value";
- tmpl_item.update();
- // #parent-tmpl > div.stuff will now be empty!
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement