title: Trying to display data from a database in HTML tags using Javascript
body: <p>I'm trying to call a function in my home page that will change the content of an article in HTML from placeholders to info from a database before the page loads.  However I keep getting an error saying that I'm missing a formal parameter.  What have I done wrong?</p>
  
  <p>The HTML:</p>
  
  <pre><code>&lt;article id="article1"&gt;
      &lt;img src="images/sadface.png" alt="The image didn't load, sorry" id="img0"&gt;
      &lt;h4 id="heading0"&gt;Not working&lt;/h4&gt;
      &lt;p id="p0"&gt;This item hasn't loaded, sorry&lt;/p&gt;
      &lt;script&gt;
          window.onload = function splashFunction(0);
      &lt;/script&gt;
  &lt;/article&gt;
  </code></pre>
  
  <p>And the Javascript:</p>
  
  <pre><code>function splashFunction(x){
  
  document.getElementById("img" + x).src="images/cart2.jpg";
  
  document.getElementById("heading" + x).innerHTML="cart";
  
  document.getElementById("p" + x).innerHTML="cart";
  };
  </code></pre>