can't add external javascript file to html I tried all method help please | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

can't add external javascript file to html I tried all method help please

13th Sep 2016, 3:54 PM
Urjasvi Suthar
Urjasvi Suthar - avatar
4 Respuestas
+ 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>
13th Sep 2016, 3:59 PM
Zen
Zen - avatar
+ 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>
14th Sep 2016, 10:06 AM
Tama Lebarbu
Tama Lebarbu - avatar
+ 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>
15th Sep 2016, 3:29 PM
Aman
+ 1
thank you all I DID IT
17th Sep 2016, 3:40 PM
Urjasvi Suthar
Urjasvi Suthar - avatar