0
Import external js
How can I import all functions of an external javascript. Is there any easy way to do that?
6 Answers
+ 2
Umm yeah ? Did you mean js to js
You can use require
Or import in ES6
+ 1
Yes
<script src="path/to/script.js"></script>
0
Yes but that's in the html
0
I have two js files and I need a function from one file in the other
0
I did that already wit
0
Yes you can wrap the function as a module, then import to the other file
Is it for webpage ? If it is you can also import js in their html page like usual, it'll work. As long as the "imported file" are imported before the file that use it.