javascript - Calling "HTML components" from within JS files -


i've been seeking use javascript load content way php require, require_once , include, came this:

in 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>&copy;2015, cuidar saÚde. todos os direitos reservados</p><p>andré lemos - master design</p></footer>'); 

it works, since i'm not js expert, ask: bad thing do? have concern performance problems? better ideas?

yes, idea implement. but, take care. since importing footer script tag supposed written @ end of whole html content.


Comments