【问题标题】:IFrame sometimes not working in IE11IFrame 有时无法在 IE11 中运行
【发布时间】:2018-11-08 15:11:51
【问题描述】:

我使用 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);
  }

【问题讨论】:

    标签: angular iframe ie11-developer-tools


    【解决方案1】:

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

    【讨论】:

    • 我将/#/ 更改为#/,然后iframe 出现了。 :)
    猜你喜欢
    • 2014-06-06
    • 2012-09-19
    • 1970-01-01
    • 2019-12-13
    • 2020-03-31
    • 1970-01-01
    • 2015-07-21
    • 2018-07-15
    • 1970-01-01
    相关资源
    最近更新 更多