1 reply [Last post]
agg_rohit
Offline
newbie
Last seen: 15 years 38 weeks ago
Joined: 2005-01-27
Posts: 1
Points: 0

I want to print different domain's pages print that are opened in Iframe.
I need some solution regarding this.
I am not able to find any solution till now. I am getting "denied access error" .Want to get print of google.com's page.

I created simple 3 files started.html,A.html,B.html
*********
started.html
<HTML>
<HEAD>
<script>
function PrintFrame()
{
windowrames["A"].focus();
window.frames["A"].print();

}
</script>
</HEAD>

<BODY>

</BODY>
</HTML>
<A HREF="#" onclick="PrintFrame()">Print</A>
<IFRAME SRC="A.html" NAME="A" ></IFRAME>

<br><br><br><br><A HREF="B.html" target=A>Click here</A>
*************
*************
A.html
<HTML>
<BODY>
Here i am in window A <a href=http://google.com>google</a>
</BODY>
</HTML>
*************
*************
B.html
<HTML>
<BODY>
Here i am in window B <a href=http://google.com>google</a>
</BODY>
</HTML>

Tags:
rbolwerk
rbolwerk's picture
Offline
Enthusiast
Last seen: 13 years 36 weeks ago
Joined: 2004-11-30
Posts: 71
Points: 0

javascript does not allow it

What you propose might require a more complex solution. Javascript does not allow what you want. The pages must be on the same domain.

I ones solved this by first getting the html code of the external document (with ASP this can be easily done) putting that in a variable and then printing it.

Anyway, that was my 2 cents ...

remco