IFrame 有时无法在 IE11 中工作

IFrame sometimes not working in IE11

我使用 Angular 5 开发了一个 Web 应用程序,我从中加载了一个 Iframe。部署到 IIS 后,Iframe 内容在 Google chrome 中工作得很好,但在 IE11 中有时工作,有时不工作。

但是当 IE 中的开发工具 (F12) 打开时,它可以流畅地工作。似乎是什么问题?

提前致谢。

这是我在 html 组件中的代码:

<iframe name="encode" [src]="trustedUrl"
style="height: 100%; width: 100%; min-height: 500px;" 
frameborder="0" scrolling="yes" 
id="iframe"></iframe>

这是 Typescript 代码:

  ngOnInit(): void {
    this.empNo = localStorage.getItem('currentUser'); 
    this.settingsUrl = 'http://phlsvr500:81/csauthor#/settings/' + this.empNo;
    this.trustedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.settingsUrl);
  }

我通过修改下面的代码弄明白了: this.settingsUrl = 'http://phlsvr500:81/csauthor/#/settings/' + this.empNo; 注意# 之前的额外/。