Requirejs loading

File: requirejs_loading.html (click for a live demo)

<!DOCTYPE html>
<html>
<head>
  <title>math.js | require.js loading</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.20/require.min.js"></script>
</head>
<body>

<script>
  // load math.js using require.js
  require(['https://unpkg.com/mathjs@5.0.4/dist/math.min.js'], function (math) {
    // evaluate some expression
    const result = math.eval('1.2 * (2 + 4.5)')
    document.write(result)
  })
</script>

</body>
</html>
Fork me on GitHub