此javascript获取要加载到页面上的iFrame。它赢了';不加载在IE。。。
这是我们用来调用iframe的js。在IE中,它要么超时,要么得到一个“ Internet Explorer无法加载“页面”消息。它在Chrome和Firefox中运行良好如有任何见解,将不胜感激……此javascript获取要加载到页面上的iFrame。它赢了';不加载在IE。。。,javascript,internet-explorer,iframe,internet-explorer-8,internet-explorer-9,Javascript,Internet Explorer,Iframe,Internet Explorer 8,Internet Explorer 9,这是我们用来调用iframe的js。在IE中,它要么超时,要么得到一个“ Internet Explorer无法加载“页面”消息。它在Chrome和Firefox中运行良好如有任何见解,将不胜感激…… (function () { function f(i) { if (i.origin !== e + "" + n) { return } if (i.data === "destroy_bookmarklet")
(function () {
function f(i) {
if (i.origin !== e + "" + n) {
return
}
if (i.data === "destroy_bookmarklet") {
var s = document.getElementById(g);
if (s) {
document.body.removeChild(s);
s = null
}
}
}
var e = "http://",
n = "URL GOES HERE",
g = "ID_div",
r = "ID_content_iframe",
i = document.getElementById(r);
if (i) {
return
}
var d = document.createElement("div"),
s = e + "" + n + "/post/create?response_type=embed",
o = document.createElement("iframe");
d.id = g;
d.style.position = "absolute";
d.style.top = "0";
d.style.left = "0";
d.style.height = "100%";
d.style.width = "100%";
d.style.zIndex = "16777270";
o.id = r;
o.src = s + "&link=" + encodeURIComponent(window.location.href) + "&title=" + encodeURIComponent(document.title) + "&description=" + encodeURIComponent("" + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text));
o.style.height = "600px";
o.style.width = "650px";
o.style.border = "10px solid #333333";
o.style.marginTop = "100px";
o.style.marginLeft = "auto";
o.style.marginRight = "auto";
o.style.display = "block";
o.style.background = "#ffffff";
o.style.overflowY = 'scroll';
o.style.overflowX = 'hidden';
document.body.appendChild(d);
d.appendChild(o);
var u = window.addEventListener ? "addEventListener" : "attachEvent";
var a = u == "attachEvent" ? "onmessage" : "message";
window[u](a, f, false)
})();
window.window[u](a,f,false)代码>?
if (el.addEventListener){
el.addEventListener('your function', yourtext, false); //this is for IE 9 to above
} else if (el.attachEvent){
el.attachEvent('your function', yourtext);//this is for IE 9 to lower
}