title: Javascript - refresh iframe not working
body: <p>I have search for multiple post regarding the same topic but those posts are few years ago.</p>
  
  <p>I did tried with below code but still not working:</p>
  
  <pre><code>document.getElementById('iframeid').src = document.getElementById('iframeid').src
  </code></pre>
  
  <p>or</p>
  
  <pre><code>document.getElementById('iframeid').contentWindow.location.reload()
  </code></pre>
  
  <p>or </p>
  
  <pre><code>document.getElementById('iframeid').contentWindow.location.reload(true)
  </code></pre>
  
  <p>My iframe code is:</p>
  
  <pre><code>&lt;iframe src="./storefront.html" height="100%" width="100%" id="iframeid"&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>My JS code is:</p>
  
  <pre><code>function ThemeA(){
      var PreHeader = document.getElementById("Pheader");
      var PreBody = document.getElementById("PBody");
      var PreProduct1 = document.getElementById("ThemeProductList1");
      var PreProduct2 = document.getElementById("ThemeProductList2");
      var PreProduct3 = document.getElementById("ThemeProductList3");
      var PreProduct4 = document.getElementById("ThemeProductList4");
      var PreProductStyle1 = document.getElementById("prod1");
      var PreProductStyle2 = document.getElementById("prod2");
      var PreProductStyle3 = document.getElementById("prod3");
      var PreProductStyle4 = document.getElementById("prod4");
  
      PreHeader.className = "PreviewHeader Theme-A-Header-Color Theme-A-Font-Color";
      PreBody.className = "PreviewBody Theme-A-Font-Family";
      PreProduct1.className = " Theme-A-Product ";
      PreProduct2.className = " Theme-A-Product ";
      PreProduct3.className = " Theme-A-Product ";
      PreProduct4.className = " Theme-A-Product ";
      PreProductStyle1.className = "Theme-A-ProductStyle";
      PreProductStyle2.className = "Theme-A-ProductStyle";
      PreProductStyle3.className = "Theme-A-ProductStyle";
      PreProductStyle4.className = "Theme-A-ProductStyle";
      document.getElementById('iframeid').contentWindow.location.reload()
  }
  </code></pre>
  
  <p>All classes been set accordingly, but the iframe refresh part just not working.</p>