我正在尝试使用iframe加载此https://www.shopify.in/website网站,但它给出了以下错误:
拒绝在框架中显示“url”,因为它设置了“X-Frame-Options” 'DENY'
在html中:
<iframe class='webPage' name="samplePage" [src]="myURL"></iframe>
在ts:
export class HomePage {
myURL: any;
constructor(public navCtrl: NavController, private sanitizer: DomSanitizer) {
}
initialize = () => {
this.myURL = this.sanitizer.bypassSecurityTrustResourceUrl('https://www.shopify.in/website');
};
ionViewDidLoad() {
this.initialize();
}
}
然后我尝试了jquery。错误消失了,但网站也没有加载。
in html:
<div id="loadExternalURL" style="width: 100%; height: 100%"></div>
在ts:
export class HomePage {
constructor(public navCtrl: NavController) {
}
initialize = () => {
$('#loadExternalURL').load('https://www.shopify.in/website');
};
ionViewDidLoad() {
this.initialize();
}
}
如何在iframe中加载此网站?