-2

我已经使用 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>

这是打字稿代码:

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

1 回答 1

1

我通过修改以下代码弄清楚了: this.settingsUrl = ' http://phlsvr500:81/csauthor/#/settings/ ' + this.empNo; 注意#之前的附加/。

于 2018-05-30T00:26:09.280 回答