I have a footer that is included in a webpage with a small javascript. Here is the small javascript:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>This is a Webpage</title>
<SCRIPT src="js/jquery-3.2.1.min.js"></SCRIPT>
<script>
$(function(){
var includes = $('[data-include]');
jQuery.each(includes, function(){
var file = '/en/inc/' + $(this).data('include') + '.html';
$(this).load(file);
});
});
</script>
</head>
<body>
<div data-include="menu"></div>
<BR><BR><BR>
Content goes here
<BR><BR><BR>
<div data-include="footer"></div>
</body>
</html>
And here is the footer that is being loaded through js:
<p>
Copyright ©
<script>
document.querySelector('#rights').innerHTML = `Copyright © ${new Date().getFullYear()}
All rights reserved | This template is made with <i class="fa fa-heart-o" aria-hidden="true"></i> by <a href="https://colorlib.com" target="_blank">Colorlib</a>`;
</script>
</p>
As you can see the footer contains another small javascript, which was given to me in a stackoverflow question (JQuery .load() function doesn’t work because file loaded contains small JS). The hack works fine, except in mobile: when I open the webpage in mobile, the copyright doesn’t show ( http://guardian-angels.orgfree.com/ ). Can anybody help me fix it please? I’m very new to webpage stuff.