Getting InnerHtml
Hai,
Anybody have a solution ?
I want to load one site to an Iframe
<iframe src="http://www.google.com" name="frame1" id="frame1">
</iframe>
Then I want to get the InnerHtml of this Iframe. So I use
following javascript.
<script language="JavaScript">
var myHTML;
var myhtml=document.frames["frame1"].document.body.innerHTML;
myHTML = myhtml.replace(/>/,">");
myHTML = myhtml.replace(/</,"<");
document.getElementById('frame1').document.body.in nerHTML= myHTML;
</script>
Then I am getting an error "Access is Denied" which is in line,
var myhtml=document.frames["frame1"].document.body.innerHTML;
First I thought it is because the site is not loaded fully. But it is not the reason.
The same code is working fine when I am giving the Iframe src to our intranet pages.
Anybody can comment on this
Thanks
Ghari
|