I have a html file that has the following jquery script in the head section.
I want to add to many html files without having to copy the whole thing into the head section.
Can I use link to do that?
Thanks in advance.
<script
src="https://code.jquery.com/jquery-3.3.1.js"
integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
crossorigin="anonymous">
</script>
<script>
$(function(){
$("#footer").load("../footer.html");
});
</script>
I tried using this, but it didn’t work.
<link rel="stylesheet" type="text/css" href="../jquery-script.txt">
New contributor
1