Given the following project structure:
/root /static script.js page.html This will 'import' script.js, into the HTML file:
<html> <head> <script src="/static/script.js"></script> </head> <body> ... </body> </html> this will, as well:
<html> <head> <script src="./static/script.js"></script> </head> <body> ... </body> </html> I am wondering:
- Is one way preferred over the other?
- Are there any cases, when
/and./, in shesrcattribute of<script>will behave differently?