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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a nested-frame page 1

Status
Not open for further replies.

davideart

Programmer
Apr 4, 2001
55
IT
Hi all.
I have a 3-frame web site (left,top,main) and i insterted a "print" function in the top frame.The print function only prints the main frame, calling the following easy code:
Code:
function PrintPage()
{
parent.main.focus();
parent.main.print();
}
Everything works fine as long as main frame contains an individual document.
If the doc in the main frame is, on its turn, divided into 3 frames (let's call them B1,B2,B3), the PrintPage() function will print (of course) the 3 frames on 3 separated papers.
I'd like to print only B2 frame but the following function (and all similar):
Code:
function printpage()
{
var bodyframe=parent.frames.main;
bodyframe.frames.B2.focus();
bodyframe.frames.B2.print();
}
returns an "ACCESS DENIED" error.

Any idea or hint?
As a workaround, i could accept the function to print the 3 inner frames, if only they were printed on a single paper!
Thank you in advance, have a nice 2004 :)
David
 
Hi jemminger, thank for your advices about threads..they were both useful in order to get to a solution.
In case someone is interested that's what i did:
Code:
function printpage()
	{
	var bodyframe=parent.frames.main;
	if(parent.frames.main.frames.length>0){	
	  bodyframe.frames.B2.focus();
	  window.print();
	}
        else
          //usual printing routine       
	}

Thanks again for help, cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top