minnirok
asked on
Get contents of iframe
Hi,
I just want to get the contents of an iframe on my page. My iframe is defined like:
<iframe id = "e_body" name = "e_body" src="about:blank"></iframe >
Now I have a function where I want to get the inner contents of the frame, whatever the user has typed in there:
function GetIFrameContentsPlease()
{
var strContents = document.getElementById("e _body").do cument.bod y.innerHTM L;
alert("the contents are: " + strContents);
}
But getting the content always fails, how can I get it?
I just want to get the contents of an iframe on my page. My iframe is defined like:
<iframe id = "e_body" name = "e_body" src="about:blank"></iframe
Now I have a function where I want to get the inner contents of the frame, whatever the user has typed in there:
function GetIFrameContentsPlease()
{
var strContents = document.getElementById("e
alert("the contents are: " + strContents);
}
But getting the content always fails, how can I get it?
document.frames("e_body"). document.b ody.innerH TML;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Because of security concerns, you cannot get the innerHTML cross domain (without appropriate priviledges).
ASKER
yes finally it works!