mathjs/examples/browser/requirejs_loading.html.md
2015-11-28 21:45:55 +01:00

33 lines
685 B
Markdown

---
layout: default
---
# Requirejs loading
File: [requirejs_loading.html](requirejs_loading.html)
```html
<!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(['http://cdnjs.cloudflare.com/ajax/libs/mathjs/2.4.2/math.min.js'], function (math) {
// evaluate some expression
var result = math.eval('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. -->