<head>
</head>
<body>
<script>
var ifr = document.createElement("iframe");
document.getElementsByTagName("body")[0].appendChild(ifr);
ifr.onload = function(){ alert(document.body.innerHTML); };
ifr.src = "add_land.asp";
</script>
</body>这样就可以了
但问题是我需要把它放到head里
但那样会出错
有什么办法啊
</head>
<body>
<script>
var ifr = document.createElement("iframe");
document.getElementsByTagName("body")[0].appendChild(ifr);
ifr.onload = function(){ alert(document.body.innerHTML); };
ifr.src = "add_land.asp";
</script>
</body>这样就可以了
但问题是我需要把它放到head里
但那样会出错
有什么办法啊
<script>
var ifr = document.createElement("iframe");
document.getElementsByTagName("head")[0].appendChild(ifr);
ifr.id="ddd"
ifr.onload = function(){ alert(ddd.document.body.innerHTML); };
ifr.src = "add_land.asp";
</script>
</head>
<body></body>加个id就可以了
document.getElementsByTagName("head")[0].appendChild(ifr);
ifr.id = this.Iframe;
ifr.attachEvent("onload",new Function("if(!this.src){alert("+this.Iframe+".document.body.innerHTML);}"))为什么这样才能正常显示
应该是if(this.src)才对的啊
别费心了...
function lf(i){
try{
var h=Head.document,l=Left.document,r=Right.document;
if(i=="Head"){
h.onkeydown=dh;
}else if(i=="Left"){
l.onkeydown=dl;
}else if(i=="Right"){
r.onkeydown=dr;
}
document.title=h.title+" - "+l.title+" - "+r.title;
}catch(e){}
}这是我写的.可以的!
只有 body, img, script 有...楼上你觉得那样可行吗?