Hi i'm bothering with such problem... I must dynamic create an Iframe, and
then put som raw HTML into it. But I can't.
When I create iframe, I can't access its properties.
Here's the coe snipplet:
//*************** *************** *******
//*************** *************** *******
function doTheIframe(naz wa, width, height) {
ifrm = document.create Element("iframe ");
ifrm.setAttribu te("name", nazwa);
ifrm.setAttribu te("id", nazwa);
ifrm.setAttribu te("src", "");
ifrm.style.widt h.value = width+"px";
ifrm.style.heig ht.value = height+"px";
document.body.a ppendChild(ifrm );
}
function main() {
doTheIframe('sm allframe',100,1 00);
document.getEle mentById('small frame').content Window.document .body.innerHTML =
"TEST";
}
<a onclick="main() ">Tratatata </a>
//*************** *************** *******
//*************** *************** *******
When I click the link, iframe is created but not pupulated.
When I click for the second time, second frame is created and the first one
is populated.
I want to populate the iframe immediately.
How to do this?
Regards,
Templar
then put som raw HTML into it. But I can't.
When I create iframe, I can't access its properties.
Here's the coe snipplet:
//*************** *************** *******
//*************** *************** *******
function doTheIframe(naz wa, width, height) {
ifrm = document.create Element("iframe ");
ifrm.setAttribu te("name", nazwa);
ifrm.setAttribu te("id", nazwa);
ifrm.setAttribu te("src", "");
ifrm.style.widt h.value = width+"px";
ifrm.style.heig ht.value = height+"px";
document.body.a ppendChild(ifrm );
}
function main() {
doTheIframe('sm allframe',100,1 00);
document.getEle mentById('small frame').content Window.document .body.innerHTML =
"TEST";
}
<a onclick="main() ">Tratatata </a>
//*************** *************** *******
//*************** *************** *******
When I click the link, iframe is created but not pupulated.
When I click for the second time, second frame is created and the first one
is populated.
I want to populate the iframe immediately.
How to do this?
Regards,
Templar
Comment