requirejs_loading.html (470B)
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="utf-8"> 5 <title>math.js | require.js loading</title> 6 <script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.20/require.min.js"></script> 7 </head> 8 <body> 9 10 <script> 11 // load math.js using require.js 12 require(['../../lib/browser/math.js'], function (math) { 13 // evaluate some expression 14 const result = math.evaluate('1.2 * (2 + 4.5)') 15 document.write(result) 16 }) 17 </script> 18 19 </body> 20 </html>