-
Hey, I am getting into HTML and JS for making a game and I was wondering how you integrated the js scripts into the html without using <script> in the html. How would this be done, and how did you do it? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You will see a few script tags at the bottom of the original .html file, but most of the tags in the @Toby222 's screenshot are generated. I use a JavaScript module loader called RequireJS. This is what refers to it in the html file: This project was started a long time ago and JavaScript evolves quite fast, so I'm not sure this approach is the way to go today. I think in modern JavaScript it's possible to do something similar without a 3rd party library like Require. But it works well for Level 13. |
Beta Was this translation helpful? Give feedback.
You will see a few script tags at the bottom of the original .html file, but most of the tags in the @Toby222 's screenshot are generated. I use a JavaScript module loader called RequireJS. This is what refers to it in the html file:
<script data-main="src/config" src="lib/requirejs/require.min.js"></script>
This project was started a long time ago and JavaScript evolves quite fast, so I'm not sure this approach is the way to go today. I think in modern JavaScript it's possible to do something similar without a 3rd party library like Require. But it works well for Level 13.