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).
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?
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 :).
<script type="text/javascript">
document.querySelector('myIframe').addEventListener("load", ev => {
console.log('iframe is completely loaded');
})
</script>