Преглед на файлове

Merge pull request #367 from p2/master

Change example to use `script` instead of `textarea`
tags/v1.0.0
Jan Lehnardt преди 12 години
родител
ревизия
ba510eb354
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. +3
    -3
      README.md

+ 3
- 3
README.md Целия файл

@@ -51,16 +51,16 @@ If you need a template for a dynamic part in a static website, you can consider
<html>
<body onload="loadUser">
<div id="target">Loading...</div>
<textarea id="template" style="display:none;">
<script id="template" type="x-tmpl-mustache">
Hello {{ name }}!
</textarea>
</script>
</body>
</html>
```

```js
function loadUser() {
var template = $('#template').val();
var template = $('#template').html();
Mustache.parse(template); // optional, speeds up future uses
var rendered = Mustache.render(template, {name: "Luke"});
$('#target').html(rendered);


Loading…
Отказ
Запис