| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<script src='https://unpkg.com/[email protected]/require.js'></script> |
| 5 |
<script> |
| 6 |
require.config({ |
| 7 |
paths: { |
| 8 |
mustache: '../../../mustache' |
| 9 |
} |
| 10 |
}); |
| 11 |
|
| 12 |
// Placed here rather in the -test.js file because it makes debugging in |
| 13 |
// a local browser simpler because this .html file can be opened by double |
| 14 |
// clicking the file and inspecting any errors/unexpected results |
| 15 |
requirejs(['mustache'], Mustache => { |
| 16 |
document.body.textContent = Mustache.render( |
| 17 |
'{{title}} spends {{calc}}', |
| 18 |
{ |
| 19 |
title: 'Joe', |
| 20 |
calc: () => 2 + 4 |
| 21 |
}); |
| 22 |
}); |
| 23 |
</script> |
| 24 |
</head> |
| 25 |
<body>Text content to be overwritten<body> |
| 26 |
</html> |