I've been seeking to use Javascript to load content just the way PHP does with require, require_once and include, so I came to this:
In the HTML source:
<script src="footer.js"></script>
The footer.js file:
document.write('<footer id="footer" class="fluid"><div id="callaction"><p>A sua saúde está em dia? Confira aqui</p></div><p>©2015, CUIDAR SAÚDE. Todos os direitos reservados</p><p>André Lemos - Master Design</p></footer>');
It works, but since I'm not a JS expert, I ask: Is this a bad thing to do? Do I have to concern about performance problems? Better ideas?
Yes, it is a good idea to implement. But, take care. Since you are importing footer the script tag is supposed be written at the end of whole html content.
Linking the JS script which outputs something to the document isn't very good idea. The concept has several problems:
But you also have to consider the situation in which you wanna use this "content including" before you use or let it. If you just use it for common footer, the concept might be satisfiable.
If you want/need to use some server-side solution because of the problems described above, but you don't want to use PHP and its include
statement, you could try Server-Side Includes module for Apache.