Jump to content

[SOLVED] Get info from iframe


therealwesfoster

Recommended Posts

Heres the code

 

ifrm = document.createElement("IFRAME");
ifrm.setAttribute("src", "http://google.com/");
ifrm.setAttribute("frameborder", "0");
ifrm.setAttribute("name", "gf");
ifrm.style.width = 300+"px";
ifrm.style.height = 300+"px";
document.body.appendChild(ifrm);

document.getElementsByTagName('font')[10].innerHTML = "TEST";
document.getElementById('txtSubject').value = "TEST2";

if (window.frames['gf'].location.href == "http://google.com/")
{
alert(window.frames['gf'].getElementsByName('test_input').innerHTML);
}

 

Im wanting to open an iframe, get a certain input from that page, then alert it in the iframe. But it's all being controlled by the parent window. I know ajax would be easier, but I've not learned it yet and haven't found a good place to learn it.

 

But please help, thanks

Link to comment
https://forums.phpfreaks.com/topic/80429-solved-get-info-from-iframe/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.