title: Using js to create 'page parts' for a website
body: <p>So, I'm learning JavaScript and wanted to take what I learn and create a personal website to test. I like using themes because it keeps my interest, I based my website off the terminal computers from the Fallout universe (the video game).</p>
  
  <p>In Short: What I would like to know is how to "call" the js file into the html page. I want to be able to show the js code in the html page. I'm not too worried about if my js code is correct as far as the js files. I'm still training in that. I'm just very confused no how to display my html code I wrote in a javascript document for the purpose of displaying in every html page I write. I hope that makes sense lol.
  I like organization and going to one place to change something if needed. In my head, this would be possible to do with html + javascript.</p>
  
  <p>Here is basically how I'd like it to work (at least in my head lol):</p>
  
  <p><strong>FILES</strong></p>
  
  <blockquote>
    <p>RobCo (Files root path): </p>
    
    <p>index.html </p>
    
    <p>aboutUs.html</p>
    
    <p>styles.css</p>
    
    <p>pageParts (Robco/pageParts) file path:</p>
    
    <p>SiteHeading.js</p>
    
    <p>SiteFooter.js</p>
  </blockquote>
  
  <p>I would like to go into index.html and have the code/information display from SiteHeading.js to display.</p>
  
  <p>I'm currently learning about js, particularly about using html tags and what not so I dont need info on that.</p>
  
  <p>What I would like to know is how to "call" the js file into the html page.</p>
  
  <p>I thought something like this would work but has not, <code>&lt;script&gt;document.write(robcoSiteHeading.js)&lt;/script&gt;</code></p>
  
  <p>For testing purposes I moved robcoSiteHeading into the RobCo folder so all files are in the same folder. Just to make sure the code is right rather than a file pathing issue. Still no joy.</p>
  
  <p>Here are some examples of my code:</p>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;!-- RobCo Home Page when the site is loaded initially --&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;RobCo Terminal Home&lt;/title&gt;
  &lt;link rel="stylesheet" href="styles.css"&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
    &lt;!-- Terminal Header; used as the terminal's Header or first text. [InsertPageHeadingHere]--&gt;
    &lt;script&gt;document.write(robcoSiteHeading.js)&lt;/script&gt;
  
  
  
  &lt;!-- Main Text --&gt;
    &lt;p&gt;STATUS: Unit(s) Active
    &lt;br/&gt;
    CONNECTED: 1 Unit(s) Connected to this terminal.
    &lt;br/&gt;&lt;br/&gt;
    Please choose an option:
    &lt;br/&gt;
  
    &lt;!-- Clickable Options --&gt;
    &lt;p&gt;
    &lt;a href="login.html"&gt;[Login]&lt;/a&gt;
    &lt;br/&gt;
    &lt;a href="DefenseProtocol.html"&gt;[Engage Defense Protocal]&lt;/a&gt;
    &lt;br/&gt;
    &lt;a href="SelfDestruct.html"&gt;[Initiate Self Destruct]&lt;/a&gt;
    &lt;br/&gt;
    &lt;a href="aboutUs.html"&gt;[About Us]&lt;/a&gt;
    &lt;/p&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>robcoSiteHeading.js testing section, If That works I can figure out the rest of the js code during my training.</strong></p>
  
  <pre><code>// Terminal Header; used as the terminal's Header or first text on nearly every page.
  
  let siteHeading;
  let testing;
  
  // //siteHeading = `
  //   &lt;p&gt;
  //   ==================================================
  //   &lt;/p&gt;
  //   &lt;p&gt;Welcome to ROBCO Industries (TM) Termlink&lt;/p&gt;
  //   &lt;p&gt;USAF Terminal Controler v0.01 &lt;/p&gt;
  //   &lt;p&gt;
  //   ==================================================
  //   &lt;/p&gt;
  //   &lt;p&gt;
  //   This interface should be used by RobCo-licensed technicians only. The client
  //    must only be operated by official personal of USAF or by pre-approved clients.
  //   &lt;br/&gt;&lt;br/&gt;
  //   &lt;/p&gt;
  // `;
  
  testing = '
    &lt;p&gt; ================================================== &lt;/p&gt;
  
    &lt;p&gt; USAF Terminal Controler v0.01 &lt;/p&gt;
  ';
  </code></pre>