HTTPS iframe显示为HTTP(混合内容)

时间:2015-09-08 12:58:58

标签: html http iframe https

我有一个带有HTTPS URL的iframe,显示为HTTP。我似乎无法弄清楚为什么它将我的HTTPS链接显示为HTTP并因此抛出混合内容错误。提前谢谢。

<html>
<head>
<script type="text/javascript">
//<![CDATA[
try{if (!window.CloudFlare) {var CloudFlare=[{verbose:0,p:0,byc:0,owlid:"cf",bag2:1,mirage2:0,oracle:0,paths:{cloudflare:"/cdn-cgi/nexp/dok3v=1613a3a185/"},atok:"648d22a7cbd8d39ff6c1d603172e4867",petok:"c4b2f316536247173a516f5b497b137d814de31b-1441717697-86400",betok:"907c8bfe67d347db6e2954b8e5aae965c633df1e-1441717697-120",zone:"addmilk.nl",rocket:"0",apps:{"ga_key":{"ua":"UA-64317812-1","ga_bs":"2"}}}];!function(a,b){a=document.createElement("script"),b=document.getElementsByTagName("script")[0],a.async=!0,a.src="//ajax.cloudflare.com/cdn-cgi/nexp/dok3v=e9627cd26a/cloudflare.min.js",b.parentNode.insertBefore(a,b)}()}}catch(e){};
//]]>
</script>
<script type="text/javascript">
/* <![CDATA[ */
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-64317812-1']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

(function(b){(function(a){"__CF"in b&&"DJS"in b.__CF?b.__CF.DJS.push(a):"addEventListener"in b?b.addEventListener("load",a,!1):b.attachEvent("onload",a)})(function(){"FB"in b&&"Event"in FB&&"subscribe"in FB.Event&&(FB.Event.subscribe("edge.create",function(a){_gaq.push(["_trackSocial","facebook","like",a])}),FB.Event.subscribe("edge.remove",function(a){_gaq.push(["_trackSocial","facebook","unlike",a])}),FB.Event.subscribe("message.send",function(a){_gaq.push(["_trackSocial","facebook","send",a])}));"twttr"in b&&"events"in twttr&&"bind"in twttr.events&&twttr.events.bind("tweet",function(a){if(a){var b;if(a.target&&a.target.nodeName=="IFRAME")a:{if(a=a.target.src){a=a.split("#")[0].match(/[^?=&]+=([^&]*)?/g);b=0;for(var c;c=a[b];++b)if(c.indexOf("url")===0){b=unescape(c.split("=")[1]);break a}}b=void 0}_gaq.push(["_trackSocial","twitter","tweet",b])}})})})(window);
/* ]]> */
</script>
</head>
<body>
<iframe src="https://cdn.addmilk.nl/track?id=1&amp;preview_id=150908_thuiscomfort_tell_badkamer_728x90&amp;preview_name=Thuiscomfort%20-%20Tell%20-%20Badkamer%20-%20728x90" frameborder="0" width="1" height="1"></iframe>
</body>
</html>

加载页面时出现以下错误,即使我的src URL是通过HTTPS加载的:

  

混合内容:“https://demo.addmilk.nl/test.html”的页面是   通过HTTPS加载,但请求不安全的资源   'http://cdn.addmilk.nl/track/?id=1&preview_id=150908_thuiscomfort_tell_badkamer_728x90&preview_name=Thuiscomfort%20-%20Tell%20-%20Badkamer%20-%20728x90'。   此请求已被阻止;内容必须通过HTTPS提供。

1 个答案:

答案 0 :(得分:0)

查看浏览器的开发工具控制台。在网络选项卡中,您应该看到请求和使用的协议(http或https)。

也许cdn.addmilk.nl重定向到http?