+ 1
can't add external javascript file to html I tried all method help please
4 Antworten
+ 3
<script src="path/to/your/jsfile.js"></script>
If your file is in the same folder as the html, just put the name of the script.
<script src="jsfile.js"></script>
+ 2
It could be a link too.
<script src="https://www.myserver.org/jsfile.js"></script>
<script src="https://www.framework.com/jsfile.min.js"></script>
+ 1
my_folder
|---- index.html
|---- scripts
|---- myscript.js
|---- styles
|---- mystyle.css
<link rel="stylesheet" type="text/css" href="./mystyle.css">
<script src="./myscript.js"></script>
// if index.html for example in my_folder/template/index.html,
<script src="../myscript.js"></script>
+ 1
thank you all
I DID IT