amd.html 726 B

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