title: Javascript - Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'
body: <p>I am getting the following error:</p>
  
  <blockquote>
    <p>Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'</p>
  </blockquote>
  
  <p>I have the problem with Stickyfill source (<a href="https://github.com/wilddeer/stickyfill" rel="nofollow noreferrer">https://github.com/wilddeer/stickyfill</a>)</p>
  
  <p>I have tried more versions I still get the same error. My JavaScript source looks like this:</p>
  
  <pre><code>var a = document.getElementById('left');
  Stickyfill.add(a);
  </code></pre>
  
  <p>Why am I getting this error, how can I fix it?</p>
  
  <p>EDIT:
  This is my html page:</p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;&lt;/title&gt;
          &lt;link rel="stylesheet" type="text/css" href="css-home.css"&gt;
          &lt;script type="text/javascript" src="stickyfill.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="js-home.js"&gt;&lt;/script&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
  
          &lt;div id="container"&gt;
              &lt;div id="banner"&gt;
                  &lt;img src="sigla.jpg"&gt;
              &lt;/div&gt;
              &lt;div id="container2"&gt;
                  &lt;div id="left"&gt;
                      &lt;nav&gt;
                      &lt;a target="ifr" href=""&gt;Home&lt;/a&gt;
                      &lt;a target="ifr" href=""&gt;Istoric&lt;/a&gt;
                      &lt;a target="ifr" href="echipa.html"&gt;Echipa&lt;/a&gt;
                      &lt;a target="ifr" href=""&gt;Galerie&lt;/a&gt;
                      &lt;/nav&gt;
                  &lt;/div&gt;
                  &lt;div id="right"&gt;
  
                      &lt;iframe name="ifr" src="echipa.html" frameborder="0" &gt;&lt;/iframe&gt;
  
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div id="footer"&gt;
                  &lt;p&gt;CS MIOVENI&lt;/p&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>LATER EDIT: 
  i have solved the problem using <strong>window.onload</strong> for my javascript file</p>