title: How to check if in a Blazor server app a iframe has finished loading content?
body: <p>I load different htmlpages inside a Iframe in a blazor server app. To change the content of the Iframe I use multiple buttons. On click of a button a corresponding Html page is loaded in the  Iframe (one Iframe - diffenrent content - changed via button click).</p>
  <p>How can I check if content is fully loaded after click? Reason for this is, right now if the user is clicking different buttons to fast after one an other the Iframe doesn't show content at all (only the backgroundcolor of the underlying grid and stalles). Can I get a bool value back after Iframe has finished loading?</p>
  <p>Please I wouln't be into Blazor if I had knowledge from Js. I have found posts where js is the solution for this but. I don't know how to properly implemnt that into my blazor app. I can't simply copy that js into the hmtlpage. It has to be in the file _Host.cshtml but if I put it there the ...document.querySelector('myIframe').addEventListener... sayes null in the developmenttools console. Thank you for help. Please if it has to do with js be so kind and try to explain it to me as you would to a nuub (what Iam :).</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script type="text/javascript"&gt;
          document.querySelector('myIframe').addEventListener("load", ev =&gt; {
              console.log('iframe is completely loaded');
          })
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>