How to repeat content on several static pages?

3

The question is as follows, I have only .HTML static files and am looking for a simple way to create the blocks only once using only the client side .

The idea is to respect DRY, is there any way to do this directly with JavaScript or jQuery?

    
asked by anonymous 19.01.2017 / 13:37

1 answer

5

Yes, it is possible.

Using load() jQuery

Example: load header.html content into the div with id header .

$("#header").load("public/header.html");
    
19.01.2017 / 13:45