mathjs/examples/browser/requirejs_loading.html.md
2023-10-26 10:31:15 +02:00

34 lines
737 B
Markdown

---
layout: default
---
# Requirejs loading
File: [requirejs_loading.html](requirejs_loading.html) (click for a live demo)
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<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@11.12.0/lib/browser/math.js'], function (math) {
// evaluate some expression
const result = math.evaluate('1.2 * (2 + 4.5)')
document.write(result)
})
</script>
</body>
</html>
```
<!-- Note: This file is automatically generated. Changes made in this file will be overridden. -->