Solution 1 :


Adding script from another HTML file: No

Adding script from other Javascript File: Yes

Syntax: to load external JS:

<script src="myscripts.js"></script>

Hope, It Helps.

Problem :

When writing web pages I often end up with a lot of script ot link tags in the head of each html file.
Something like this,

<link rel="stylesheet" href="css/master.css">
<link rel="stylesheet" type="text/css" href="//"/>
<script type="text/javascript" src="js/moment.js"></script>
<script type="text/javascript" src="js/index.js"></script>

Is there a way to consolidate this into one line that loads all of them from a separate file, something like this <link rel="" href="libraries.html">? Or maybe have one <link> that loads both other links? <link rel="stylesheet" href="css/master.css","//"?

I looked into doing this with a <link> but I didn’t see any obvious way.


Comment posted by epascarello

In HTML? No there is not

Comment posted by import

If you linked to a JavaScript file, you could use a bunch of