[thelist] Printing an iframe

Bill Creswell BillC at VanEerden.com
Wed Oct 22 06:15:18 CDT 2003


<a onClick="main.focus();main.print();">

With main being the iframe name and id: works in Firebird and IE

Bill Creswell
Helpdesk/Webmaster
Van Eerden Distribution
http://www.vaneerden.com
(616) 452-1426 Ext. 293
 


-----Original Message-----
From: Scott Brady [mailto:evolt at scottbrady.net] 
Sent: Tuesday, October 21, 2003 4:06 PM
To: thelist at lists.evolt.org
Subject: [thelist] Printing an iframe


Does printing an iframe work the same as printing a frame?

Here's the scenario (it's a protected site, so I don't have a URL to share):

I have a page ["A"] where pressing a "Print" form button loads content in an invisible iframe ["B"] located in page A.  When the iframe page loads, it calls a function in page A (the parent) that is supposed to print the iframe content.

I've looked in the archives, and assuming iframes work like frames in this case, the following code SHOULD work. However, it's printing the main page ["A"] instead. 

Here's the print function:

function printFrame()
{
	var pp = frames['PageProcessing'];
alert(pp.location.href);
	pp.focus();
	pp.print();
}

I've verified (with that alert) that the URL in the iframe is correct.

I'm testing in IE5.5 on Win2k.

Scott
----------------------------
Scott Brady
http://www.scottbrady.net/




More information about the thelist mailing list