Explorar el Código

Change example to use `script` instead of `textarea`

tags/v1.0.0
Pascal Pfiffner hace 12 años
padre
commit
4184761b20
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. +3
    -3
      README.md

+ 3
- 3
README.md Ver fichero

@@ -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);


Cargando…
Cancelar
Guardar