首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >IFrame有时在IE11中不起作用

IFrame有时在IE11中不起作用
EN

Stack Overflow用户
提问于 2018-05-30 05:29:48
回答 1查看 501关注 0票数 -2

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

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

提前谢谢。

下面是我在html组件中的代码:

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

下面是打字代码:

代码语言:javascript
复制
  ngOnInit(): void {
    this.empNo = localStorage.getItem('currentUser'); 
    this.settingsUrl = 'http://phlsvr500:81/csauthor#/settings/' + this.empNo;
    this.trustedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.settingsUrl);
  }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-05-30 08:26:09

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50593236

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档