我使用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);
}
发布于 2018-05-30 08:26:09
我已经通过修改下面的代码找到了答案: this.settingsUrl = 'http://phlsvr500:81/csauthor/#/settings/‘+ this.empNo;注意#之前的附加/。
https://stackoverflow.com/questions/50593236
复制相似问题