Is there a way to include all the meta tag
, link rel
and script src
includes in one file, and then require that file?
The reason I ask is because I have like 10-15 lines that i am copying into every file and figured there might be another way.
I put everything in one file and tried the Jquery load function, but to no avail.
Thanks
Create a head.html file like this:
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Meta -->
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<!-- JS -->
<script type="text/javascript" src="js/lib/jquery-1.11.min.js" ></script>
<script type="text/javascript" src="js/lib/angular.min.js"></script>
<title>Your application</title>
Now include head.html in your HTML pages like this:
<head>
<script type="text/javascript" src="js/lib/jquery-1.11.1.min.js" ></script>
<script>
$(function(){ $("head").load("head.html") });
</script>
</head>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With