Javascript Internet Explorer:混合内容交付警告

Javascript Internet Explorer:混合内容交付警告,javascript,internet-explorer,dom,ssl,https,Javascript,Internet Explorer,Dom,Ssl,Https,以下javascript导致Internet Explorer发出“混合内容”警告: 函数init(){ //如果已调用此函数,请退出 if(arguments.callee.done)返回; //标记这个函数,这样我们就不会做同样的事情两次 arguments.callee.done=true; //停止计时 如果(_定时器)清除间隔(_定时器); //做事 }; /*用于Mozilla/Opera9*/ if(文件增补列表器){ document.addEventListener(“DOMC

以下javascript导致Internet Explorer发出“混合内容”警告:

函数init(){
//如果已调用此函数,请退出
if(arguments.callee.done)返回;
//标记这个函数,这样我们就不会做同样的事情两次
arguments.callee.done=true;
//停止计时
如果(_定时器)清除间隔(_定时器);
//做事
};
/*用于Mozilla/Opera9*/
if(文件增补列表器){
document.addEventListener(“DOMContentLoaded”,init,false);
}
/*用于Internet Explorer*/
/*@抄送@*/
/*@如果(@_win32)
文件。填写(“”);
var script=document.getElementById(“\uu ie\u onload”);
script.onreadystatechange=函数(){
如果(this.readyState==“完成”){
init();//调用onload处理程序
}
};
/*@结束@*/
/*狩猎旅行*/
if(/WebKit/i.test(navigator.userAgent)){//sniff
var_timer=setInterval(函数(){
如果(/loaded | complete/.test(document.readyState)){
init();//调用onload处理程序
}
}, 10);
}
/*对于其他浏览器*/
window.onload=init;

它用于检测DOM何时完成加载。此脚本中的什么内容会导致混合内容警告?

我猜是创建了一个不使用HTTPS的脚本标记

我同意Cresent的观点,原因在(代码来源)中讨论。这类似于在通过https交付的页面上创建一个about:blank IFRAME。src必须引用https上的某些内容才能确保安全。在当今时代,你为什么还要使用这种黑客手段呢?我使用的是Magento GO托管解决方案,上传jQuery库会导致Magento模板的功能停止工作(大部分ui交互/等等)是否有更好的方法来检查DOM是否使用其他方法加载了jQuery?已解决-对于任何试图在Magento GO模板中使用jQuery库的人,必须在jQuery库的末尾调用jQuery.noConflict()。在以后的js文件中调用它不会奏效:)我不是100%确定,但我不认为IE坚持在主页打开时脚本、样式表和图像都是“https”。但是,对于
源代码,IE(和所有其他浏览器)确实要求所有脚本、样式表、图像和iFrame都是https,如果加载的页面是https。
function init() {
  // quit if this function has already been called
  if (arguments.callee.done) return;

  // flag this function so we don't do the same thing twice
  arguments.callee.done = true;

  // kill the timer
  if (_timer) clearInterval(_timer);

  // do stuff
};

/* for Mozilla/Opera9 */
if (document.addEventListener) {
  document.addEventListener("DOMContentLoaded", init, false);
}

/* for Internet Explorer */
/*@cc_on @*/
/*@if (@_win32)
  document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
  var script = document.getElementById("__ie_onload");
  script.onreadystatechange = function() {
    if (this.readyState == "complete") {
      init(); // call the onload handler
    }
  };
/*@end @*/

/* for Safari */
if (/WebKit/i.test(navigator.userAgent)) { // sniff
  var _timer = setInterval(function() {
    if (/loaded|complete/.test(document.readyState)) {
      init(); // call the onload handler
    }
  }, 10);
}

/* for other browsers */
window.onload = init;