Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting body of frame

Status
Not open for further replies.

darkling235

Programmer
Oct 30, 2006
24
US
Can anyone tell me how to get the HTML code of a page in a frame?

I'm using
function view_HTML( )
{
var newwin = window.open( "", 'templateview', 'scrollbars=yes,width=600,height=600');
newwin.document.open( );
newwin.document.write("<html><head></head><body>\n");
newwin.document.write("<textarea cols=100 rows=100 readonly=yes wrap=off>");
newwin.document.write( document.body.frame1.innerHTML );
newwin.document.write("</textarea>\n");
newwin.document.close( );
}


but it doesn't seem to want to work. Can someone tell me where I'm going wrong? Thx.
 
it doesn't work"

what error are you getting? is it a permission-denied error? if so, it's because you can't access a page via javascript that exists outside of your domain.



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Well Long story short nothing happens. I'm trying to view the source code of another page but it doesn't seem to work. Any thoughts on how I could fix it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top