![](/img/trans.png)
[英]Errors of mixed content while loading page in iframe from https to https
[英]Loading HTTP content within HTTPS with iframe
我在HTTPS
上的站點中有此代碼,它可以正常工作:
if(window.location.href == 'https:// example . com/'){
$('body').append('<iframe id="iframe" src="//URL.000webhost.com"></iframe>');
}
使用//URL . 000webhost . com
//URL . 000webhost . com
//URL . 000webhost . com
(免費子域, HTTP
)工作正常,但是我購買了另一個具有域( HTTP
)的主機以加載到iframe
,現在使用新的URL(// NEW DOMAIN .net),我看到此錯誤:
vendor.js:2取得https:// NEW DOMAIN。 凈額/凈額:: ERR_INSECURE_RESPONSE
為什么在免費托管中可以正常工作,但是在新托管中卻不能正常工作,並且如果我進行一些域名設置就可以了嗎?
使用iframe中的完整路徑(https://而不是//),因為//將默認使用http而不是https
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.