How do I call a function using requirejs?
This is too simple a question, but, surprisingly, not a single textbook or example has helped me so far.
This is the code in my html file.
...
<script src = "stuff.js"></script>
<button onclick="doStuff(4, 2)";>DoStuff</button>
...
This is my js request.
define(["jquery"], function ($) {
function doStuff(a, b) {
}
});
Why is this not working? I got ReferenceError: doStuff not defined
source
share