jQuery less. , SIEve.
function pos(obj) {
var curleft = 0;
var curtop = 0;
if (obj.offsetParent) {
do {
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
} while (obj = obj.offsetParent);
}
obj = null;
return {left:curleft, top:curtop};
}
function loadPage(url) {
var y = document.getElementById('container');
var x = document.getElementById('applicationFrame');
var p = pos(y);
if (x.src) {
var tmp = y.cloneNode(false);
var tmpIF = x.cloneNode(false);
tmpIF.src = url;
tmp.appendChild(tmpIF);
tmp.style.position = 'absolute';
tmp.style.visibility = 'hidden';
tmp.style["z-index"] = 20;
tmp.style.top = p.top;
tmp.style.left = p.left;
y.id = "delete";
x.id = "deleteApplicationFrame";
document.getElementsByTagName("body")[0].appendChild(tmp);
tmpIF = null; tmp = null;
}
setTimeout("document.getElementById('applicationFrame').style.visibility = 'visible'; var i = document.getElementById('deleteApplicationFrame'); i = i.contentDocument || i.contentWindow.document; i.documentElement.parentNode.removeChild(i.documentElement); i=null; i=document.getElementById('delete'); i.parentNode.removeChild(i); i=null;", 500);
y = null; x = null; p = null;
}
<div id="container">
<iframe id="applicationFrame" application="yes" trusted="yes" frameborder="0" src="main.php"/>
</div>
, , . IE6 - b..ch .
Internet Explorer
Internet Explorer -
, AFAIK, src HTML DOM W3C ( ?)?
src="main.php" iframe loadPage('main.php'); iframe.
<a>, <a href="notmain.php" target="nameOfYourIFrame">FooBar</a> javascript