title: Include html in html through javascript
body: <p>My question is similar to this one
  <a href="https://stackoverflow.com/questions/676394/how-to-include-an-html-page-into-an-html-page">How to include an HTML page into another HTML page without frame/iframe?</a></p>
  
  <p>But the answers are not working for me. Objects and iframes create a box with scrollbars, which I don't want, and if I have links to other pages, I would like the whole page to change, not just what's inside the box.</p>
  
  <p>This instruction doesn't work</p>
  
  <p><code>&lt;!--#include virtual="/footer.html" --&gt;</code></p>
  
  <p>I want to use only html, because this is how the website has been built and we are not redesigning it. I am only doing this for content modification purposes.</p>
  
  <p>Is it a bad practice to write an html header (or footer) in a javascript file then include the .js in all of my html files?</p>
  
  <hr>
  
  <p><strong>1st edit</strong></p>
  
  <p>I have about 70 different html static pages.
  I want to update contents such as the logo, the menu, the meta description of the web site, the text color, etc. but at the moment, I have to make each of these modifications 70 different times.</p>
  
  <p>I used javascript for the html part of the menu, because the menu worked with javascript anyway, and included the file in all of my html files.</p>
  
  <pre><code>function writeJS(){
      var strVar="";
      strVar += "&lt;body bgcolor=\"#000000\"&gt;";
      strVar += "&lt;div class=\"Main_container\"&gt;";
      ...
      document.write(strVar);
  }
  writeJS();
  </code></pre>
  
  <p>I don't know if it is a good or bad idea to do the same with those tags for example.</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org
  /TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;meta name="description" ...
  </code></pre>
  
  <hr>
  
  <p><strong>2nd edit</strong></p>
  
  <p>Although the html/javascript option was viable, we decided to invest a couple of days to go for a wordpress.org site (cheaper and better in the long run).</p>