[英]Unable to load local website inside Iframe in Edge
我有兩個站點 site-1(父)和 site-2(子)。 兩者都托管在同一網絡上 IIS V10(Windows 10)上的兩台機器上。 使用 Iframe 將站點 2 加載到站點 1 內。
站點 2 在所有瀏覽器(Chrome、Firefox、IE)但 Edge 中加載到 Iframe 中。 我在 Edge 中收到以下錯誤:
在這里,我使用 iframe 中站點 2 的 IP 地址和端口,而不是主機名。
這是我在 JS 中創建 Iframe 的方式:
var elem = document.createElement("iframe");
elem.setAttribute("src", "http://172.18.48.43:5051/play/Web/21");
elem.setAttribute("id", "site-2");
elem.style.width = 800 + "px";
elem.style.height = 300 + "px";
elem.style.border = 1 + "px solid Orange";
var frame = document.getElementById('frame');
$("#frame").html(elem);
Iframe 在兩種情況下在邊緣工作:
如果 site-1 和 site-2 都在同一台機器上。
如果不是 IP,我使用公共域主機名,如http://www.some-domain.com
我嘗試了以下解決方案,但到目前為止沒有任何效果:
https://windowsreport.com/fix-hmm-we-cant-reach-this-page-edge/
https://troubleshooter.xyz/wiki/fix-hmm-we-cant-reach-this-page-error-in-microsoft-edge/
為什么Microsoft Edge會打開一些本地網站,而不能打開其他網站,其中域名在hosts文件中路由到127.0.0.1
我有類似的問題。 您可以嘗試在另一個選項卡中加載 iframe 子應用程序(站點 2)並刷新以查看 iframe 是否會相應加載。 這對我們有用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.