I'm wondering why...
<script type="text/javascript">
define('test', [], function() {
alert('Done') ;
}) ;
</script>
... doesn't work.
I'm using my own Framework which uses RequireJS if available, and calls define(name, dependencies, callback) ; for every module loaded that requires another one.
But sometimes modules don't have dependencies, so dependencies is an empty array.
Besides I know that...
require([], function() {
alert('Done') ;
}) ;
... works fine.
Could you explain me why the first method doesn't work ? Thanks.
testmodule? If not, it won't be loaded (executed).