0

I use iframe-resizer to insert content(jsf-pages) in iframe. So, how to detect that server responsed with 404 not found?

Is there some callback or other way to detect this?

Roberto
  • 1,288
  • 5
  • 23
  • 47
  • Possible duplicate of [How to detect an error 404 in an iframe?](https://stackoverflow.com/questions/16499117/how-to-detect-an-error-404-in-an-iframe) – Esko Jun 15 '18 at 09:04

1 Answers1

0
 const iframeResizerOptions = {
    log: true,
    checkOrigin: true,
    initCallback: (iframe) => {
      if (iframe.contentDocument.getElementsByClassName("error-title").length > 0) {
        onError();
      } else {
        onLoad();
      }
    },
  };

You may use initCallback and get iframe from input parameter.

Roberto
  • 1,288
  • 5
  • 23
  • 47