3

I use an iframe to display several documents in an iframe with dynamic src. Some of them exist, but some others do not and I receive a 404 Error. Please find my code below:

<iframe class="e2e-iframe-trusted-src" style="width: 100%" height="1000" 
[src]="trustedUrl" (load)="oniFrameLoad($event)"></iframe>

Please let me know how I can handle the 404 error (or even better know beforehand that the src path does not exist and the document is not displayable).

Giannis
  • 1,790
  • 1
  • 11
  • 29
  • There is an issue associated to it. As now a day due to security reasons cross-origin flags are set. We can't directly do an XHR call as well to check the URL. If you are using link form your own side then I would suggest to you go for solution mentioned in below link https://stackoverflow.com/questions/1591401/javascript-jquery-check-broken-links – Biswajit Patra Jul 28 '20 at 15:01

0 Answers0