0

我使用iframe-resizer在 iframe 中插入内容(jsf-pages)。那么,如何检测服务器响应 404 not found 呢?

是否有一些回调或其他方法来检测这一点?

4

1 回答 1

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

您可以使用 initCallback 并从输入参数中获取 iframe。

于 2018-06-15T10:26:31.063 回答